summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-09-15 19:48:27 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-09-15 19:48:27 +0000
commit69de9805cc4e0c7bd8d3dee414fb41e15792ed6f (patch)
treefe43339a27dbf10ac8f90809a1e42450809319c4 /numpy/lib/utils.py
parent9ac3b0e5c2e181873221ff0160b882772ea9d435 (diff)
downloadnumpy-69de9805cc4e0c7bd8d3dee414fb41e15792ed6f.tar.gz
Clean up info(ndarray)
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index db7c00db6..b6ee51b91 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -213,7 +213,6 @@ def _makenamedict(module='numpy'):
thedict[modname] = moddict
return thedict, dictlist
-
def info(object=None,maxwidth=76,output=sys.stdout,toplevel='numpy'):
"""Get help information for a function, class, or module.
@@ -276,16 +275,16 @@ def info(object=None,maxwidth=76,output=sys.stdout,toplevel='numpy'):
elif inspect.isclass(object):
name = object.__name__
- if hasattr(object, '__init__'):
- arguments = apply(inspect.formatargspec, inspect.getargspec(object.__init__.im_func))
- arglist = arguments.split(', ')
- if len(arglist) > 1:
- arglist[1] = "("+arglist[1]
- arguments = ", ".join(arglist[1:])
- else:
- arguments = "()"
- else:
- arguments = "()"
+ arguments = "()"
+ try:
+ if hasattr(object, '__init__'):
+ arguments = apply(inspect.formatargspec, inspect.getargspec(object.__init__.im_func))
+ arglist = arguments.split(', ')
+ if len(arglist) > 1:
+ arglist[1] = "("+arglist[1]
+ arguments = ", ".join(arglist[1:])
+ except:
+ pass
if len(name+arguments) > maxwidth:
argstr = _split_line(name, arguments, maxwidth)