Commit e10d43e7 authored by Yuxin Wu's avatar Yuxin Wu

fix __doc__ assignment in Py3

parent c33a3ccb
......@@ -4,6 +4,7 @@
import time
import weakref
import six
from six.moves import range
import tensorflow as tf
......@@ -293,10 +294,11 @@ def _get_property(name):
"""
ret = property(
lambda self: getattr(self.loop, name))
try:
ret.__doc__ = getattr(TrainLoop, name).__doc__
except AttributeError:
pass
if six.PY3: # __doc__ is readonly in Py2
try:
ret.__doc__ = getattr(TrainLoop, name).__doc__
except AttributeError:
pass
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