Commit e10d43e7 authored by Yuxin Wu's avatar Yuxin Wu

fix __doc__ assignment in Py3

parent c33a3ccb
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import time import time
import weakref import weakref
import six
from six.moves import range from six.moves import range
import tensorflow as tf import tensorflow as tf
...@@ -293,10 +294,11 @@ def _get_property(name): ...@@ -293,10 +294,11 @@ def _get_property(name):
""" """
ret = property( ret = property(
lambda self: getattr(self.loop, name)) lambda self: getattr(self.loop, name))
try: if six.PY3: # __doc__ is readonly in Py2
ret.__doc__ = getattr(TrainLoop, name).__doc__ try:
except AttributeError: ret.__doc__ = getattr(TrainLoop, name).__doc__
pass except AttributeError:
pass
return ret return ret
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment