提交 0d4091af authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Hack around read-only __doc__ in python 2.

上级 717942e7
from __future__ import absolute_import, print_function, division
import six
import numpy as np
import unittest
from functools import update_wrapper
......@@ -58,7 +60,13 @@ def makeSharedTester(shared_constructor_,
"""
class m(type):
pass
class SharedTester(unittest.TestCase):
# This is to allow setting __doc__ with python 2
if not six.PY3:
__metaclass__ = m
shared_constructor = staticmethod(shared_constructor_)
dtype = dtype_
get_value_borrow_true_alias = get_value_borrow_true_alias_
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论