summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-02-28 11:32:12 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-02-28 11:32:12 -0700
commit80af580d76cbd18a5c91851d8b404636d8acd2a9 (patch)
treeb3ef41697787a2266c745995a59485b8762fbd6c /numpy/lib/utils.py
parent0934653e151969f6912c911b5113306bd5f450f1 (diff)
downloadnumpy-80af580d76cbd18a5c91851d8b404636d8acd2a9.tar.gz
2to3: Apply `funcattrs` fixer. Closes #3058.
This replaces the `b.func_xxxx` with newer `__xxxx__` attribute names For example, `f.__name__` replaces `f.func_name`
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index 820e6d8f9..97f8358aa 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -86,8 +86,8 @@ if sys.version_info < (2, 4):
# Can't set __name__ in 2.3
import new
def _set_function_name(func, name):
- func = new.function(func.func_code, func.func_globals,
- name, func.func_defaults, func.func_closure)
+ func = new.function(func.__code__, func.__globals__,
+ name, func.__defaults__, func.__closure__)
return func
else:
def _set_function_name(func, name):
@@ -122,7 +122,7 @@ class _Deprecate(object):
import warnings
if old_name is None:
try:
- old_name = func.func_name
+ old_name = func.__name__
except AttributeError:
old_name = func.__name__
if new_name is None:
@@ -541,7 +541,7 @@ def info(object=None,maxwidth=76,output=sys.stdout,toplevel='numpy'):
print >> output, "\n *** Total of %d references found. ***" % numfound
elif inspect.isfunction(object):
- name = object.func_name
+ name = object.__name__
arguments = inspect.formatargspec(*inspect.getargspec(object))
if len(name+arguments) > maxwidth: