Skip to content

Commit c6a5629

Browse files
Automated rollback of change 128408292
Change: 128422305
1 parent f24cc07 commit c6a5629

File tree

3 files changed

+10
-265
lines changed

3 files changed

+10
-265
lines changed

tensorflow/contrib/framework/BUILD

+3-10
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ py_test(
3838
py_test(
3939
name = "ops_test",
4040
size = "small",
41-
srcs = ["python/ops/ops_test.py"],
41+
srcs = glob(["python/ops/ops_test.py"]),
4242
srcs_version = "PY2AND3",
4343
deps = ["//tensorflow:tensorflow_py"],
4444
)
@@ -51,24 +51,17 @@ py_test(
5151
deps = ["//tensorflow:tensorflow_py"],
5252
)
5353

54-
py_test(
55-
name = "deprecation_test",
56-
srcs = ["python/framework/deprecation_test.py"],
57-
srcs_version = "PY2AND3",
58-
deps = ["//tensorflow:tensorflow_py"],
59-
)
60-
6154
py_test(
6255
name = "tensor_util_test",
63-
srcs = ["python/framework/tensor_util_test.py"],
56+
srcs = glob(["python/framework/tensor_util_test.py"]),
6457
srcs_version = "PY2AND3",
6558
deps = ["//tensorflow:tensorflow_py"],
6659
)
6760

6861
py_test(
6962
name = "variables_test",
7063
size = "small",
71-
srcs = ["python/ops/variables_test.py"],
64+
srcs = glob(["python/ops/variables_test.py"]),
7265
srcs_version = "PY2AND3",
7366
deps = ["//tensorflow:tensorflow_py"],
7467
)

tensorflow/contrib/framework/python/framework/deprecation.py

+7-13
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ def _get_qualified_name(function):
3636

3737
def _add_deprecation_to_docstring(doc, date, instructions):
3838
"""Adds a deprecation notice to a docstring."""
39-
if not doc:
40-
lines = ['DEPRECATED FUNCTION']
41-
else:
42-
lines = doc.splitlines()
43-
lines[0] += ' (deprecated)'
39+
lines = doc.splitlines()
40+
41+
lines[0] += ' (deprecated)'
4442

4543
notice = [
4644
'',
@@ -99,15 +97,11 @@ def deprecated(date, instructions):
9997

10098
def deprecated_wrapper(func):
10199
"""Deprecation wrapper."""
102-
if not hasattr(func, '__call__'):
103-
raise ValueError(
104-
'%s is not a function.'
105-
'If this is a property, add @deprecated after @property.' % func)
106100
def new_func(*args, **kwargs):
107-
logging.warning('%s (from %s) is deprecated and will be removed after %s.'
108-
'\nInstructions for updating:\n%s',
109-
_get_qualified_name(func), func.__module__,
110-
date, instructions)
101+
logging.warn('%s (from %s) is deprecated and will be removed after %s.\n'
102+
'Instructions for updating:\n%s',
103+
_get_qualified_name(func), func.__module__,
104+
date, instructions)
111105
return func(*args, **kwargs)
112106
new_func.__name__ = func.__name__
113107
new_func.__doc__ = _add_deprecation_to_docstring(func.__doc__, date,

tensorflow/contrib/framework/python/framework/deprecation_test.py

-242
This file was deleted.

0 commit comments

Comments
 (0)