diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-04-13 12:21:42 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-04-14 08:57:45 -0600 |
commit | c879ad8a39f2b74edcdaa05a2f2f854fb235537d (patch) | |
tree | 378c562ff234193cc7391a0f89095b693f42a42e /numpy/f2py/f2py2e.py | |
parent | 3f2c789ffd0d2e05596b15ea6cd644262f96200e (diff) | |
download | numpy-c879ad8a39f2b74edcdaa05a2f2f854fb235537d.tar.gz |
2to3: Apply types fixer.
Python 3 removes the builtin types from the types module. The types
fixer replaces such references with the builtin types where possible
and also takes care of some special cases:
types.TypeNone <- type(None)
types.NotImplementedType <- type(NotImplemented)
types.EllipsisType <- type(Ellipsis)
The only two tricky substitutions are
types.StringType <- bytes
types.LongType <- int
These are fixed up to support both Python 3 and Python 2 code by
importing the long and bytes types from numpy.compat.
Closes #3240.
Diffstat (limited to 'numpy/f2py/f2py2e.py')
-rwxr-xr-x | numpy/f2py/f2py2e.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/numpy/f2py/f2py2e.py b/numpy/f2py/f2py2e.py index 80569ecc6..98f58e333 100755 --- a/numpy/f2py/f2py2e.py +++ b/numpy/f2py/f2py2e.py @@ -16,17 +16,10 @@ Pearu Peterson """ from __future__ import division, absolute_import, print_function -from . import __version__ -f2py_version = __version__.version - import sys import os import pprint -import types import re -errmess=sys.stderr.write -#outmess=sys.stdout.write -show=pprint.pprint from . import crackfortran from . import rules @@ -34,7 +27,12 @@ from . import cb_rules from . import auxfuncs from . import cfuncs from . import f90mod_rules +from . import __version__ +f2py_version = __version__.version +errmess = sys.stderr.write +#outmess=sys.stdout.write +show = pprint.pprint outmess = auxfuncs.outmess try: @@ -341,7 +339,7 @@ def dict_append(d_out,d_in): for (k,v) in d_in.items(): if k not in d_out: d_out[k] = [] - if type(v) is types.ListType: + if type(v) is list: d_out[k] = d_out[k] + v else: d_out[k].append(v) |