aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/framework
diff options
context:
space:
mode:
authorGravatar IMBurbank <bassmanburbank@gmail.com>2018-09-25 18:39:11 -0600
committerGravatar IMBurbank <bassmanburbank@gmail.com>2018-09-25 18:39:11 -0600
commitf55e5ef27b3ccf1b75932e219f7358976dbf56c2 (patch)
tree5508a2b01492a41abf3452b992c8f7202053448a /tensorflow/python/framework
parent081d9b7fa17fb9f4ea39b5ac5cc20432ae5d1756 (diff)
Update to use python 2-3 compatible function tf_inspect.getfullargspec.
Diffstat (limited to 'tensorflow/python/framework')
-rw-r--r--tensorflow/python/framework/errors_impl.py2
-rw-r--r--tensorflow/python/framework/function.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/python/framework/errors_impl.py b/tensorflow/python/framework/errors_impl.py
index 5af71f2cfb..c373e75a74 100644
--- a/tensorflow/python/framework/errors_impl.py
+++ b/tensorflow/python/framework/errors_impl.py
@@ -55,7 +55,7 @@ class OpError(Exception):
def __reduce__(self):
# Allow the subclasses to accept less arguments in their __init__.
- init_argspec = tf_inspect.getargspec(self.__class__.__init__)
+ init_argspec = tf_inspect.getfullargspec(self.__class__.__init__)
args = tuple(getattr(self, arg) for arg in init_argspec.args[1:])
return self.__class__, args
diff --git a/tensorflow/python/framework/function.py b/tensorflow/python/framework/function.py
index f287289bd0..3db6f683c9 100644
--- a/tensorflow/python/framework/function.py
+++ b/tensorflow/python/framework/function.py
@@ -132,9 +132,9 @@ class Defun(object):
raise ValueError("func %s must be callable" % func)
# Func should not use kwargs and defaults.
- argspec = tf_inspect.getargspec(func)
- if argspec.keywords or argspec.defaults:
- raise ValueError("Functions with argument defaults or keyword "
+ argspec = tf_inspect.getfullargspec(func)
+ if argspec.varkw or argspec.defaults:
+ raise ValueError("Functions with argument defaults or varkw "
"arguments are not supported.")
# Computes how many arguments 'func' has.