diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/code_generators/genapi.py | 2 | ||||
-rw-r--r-- | numpy/core/setup.py | 2 | ||||
-rw-r--r-- | numpy/distutils/command/build_src.py | 8 | ||||
-rw-r--r-- | numpy/distutils/command/install.py | 2 | ||||
-rw-r--r-- | numpy/distutils/conv_template.py | 2 | ||||
-rw-r--r-- | numpy/distutils/fcompiler/__init__.py | 2 | ||||
-rw-r--r-- | numpy/distutils/fcompiler/ibm.py | 2 | ||||
-rw-r--r-- | numpy/distutils/from_template.py | 2 | ||||
-rw-r--r-- | numpy/distutils/misc_util.py | 5 | ||||
-rw-r--r-- | numpy/distutils/system_info.py | 2 |
10 files changed, 13 insertions, 16 deletions
diff --git a/numpy/core/code_generators/genapi.py b/numpy/core/code_generators/genapi.py index 426f4e05e..164232e6e 100644 --- a/numpy/core/code_generators/genapi.py +++ b/numpy/core/code_generators/genapi.py @@ -465,7 +465,7 @@ def get_versions_hash(): file = os.path.join(os.path.dirname(__file__), 'cversions.txt') fid = open(file, 'r') try: - for line in fid.readlines(): + for line in fid: m = VERRE.match(line) if m: d.append((int(m.group(1), 16), m.group(2))) diff --git a/numpy/core/setup.py b/numpy/core/setup.py index 8c43f97c0..37f649e6b 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -484,7 +484,7 @@ def configuration(parent_package='',top_path=None): else: mathlibs = [] target_f = open(target) - for line in target_f.readlines(): + for line in target_f: s = '#define MATHLIB' if line.startswith(s): value = line[len(s):].strip() diff --git a/numpy/distutils/command/build_src.py b/numpy/distutils/command/build_src.py index a9e66e6f4..cacfc472b 100644 --- a/numpy/distutils/command/build_src.py +++ b/numpy/distutils/command/build_src.py @@ -37,7 +37,7 @@ def subst_vars(target, source, d): try: ft = open(target, 'w') try: - for l in fs.readlines(): + for l in fs: m = var.search(l) if m: ft.write(l.replace('@%s@' % m.group(1), d[m.group(1)])) @@ -767,9 +767,8 @@ def get_swig_target(source): def get_swig_modulename(source): f = open(source,'r') - f_readlines = getattr(f,'xreadlines',f.readlines) name = None - for line in f_readlines(): + for line in f: m = _swig_module_name_match(line) if m: name = m.group('name') @@ -794,8 +793,7 @@ _f2py_user_module_name_match = re.compile(r'\s*python\s*module\s*(?P<name>[\w_]* def get_f2py_modulename(source): name = None f = open(source) - f_readlines = getattr(f,'xreadlines',f.readlines) - for line in f_readlines(): + for line in f: m = _f2py_module_name_match(line) if m: if _f2py_user_module_name_match(line): # skip *__user__* names diff --git a/numpy/distutils/command/install.py b/numpy/distutils/command/install.py index ea898ade9..d9b84fc08 100644 --- a/numpy/distutils/command/install.py +++ b/numpy/distutils/command/install.py @@ -64,7 +64,7 @@ class install(old_install): f = open(self.record,'r') lines = [] need_rewrite = False - for l in f.readlines(): + for l in f: l = l.rstrip() if ' ' in l: need_rewrite = True diff --git a/numpy/distutils/conv_template.py b/numpy/distutils/conv_template.py index 61200e0c1..6b969cef3 100644 --- a/numpy/distutils/conv_template.py +++ b/numpy/distutils/conv_template.py @@ -271,7 +271,7 @@ def resolve_includes(source): d = os.path.dirname(source) fid = open(source) lines = [] - for line in fid.readlines(): + for line in fid: m = include_src_re.match(line) if m: fn = m.group('name') diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py index 70093e037..510a38a58 100644 --- a/numpy/distutils/fcompiler/__init__.py +++ b/numpy/distutils/fcompiler/__init__.py @@ -971,7 +971,7 @@ def get_f77flags(src): flags = {} f = open_latin1(src,'r') i = 0 - for line in f.readlines(): + for line in f: i += 1 if i>20: break m = _f77flags_re.match(line) diff --git a/numpy/distutils/fcompiler/ibm.py b/numpy/distutils/fcompiler/ibm.py index 70373c0b0..b3126b558 100644 --- a/numpy/distutils/fcompiler/ibm.py +++ b/numpy/distutils/fcompiler/ibm.py @@ -76,7 +76,7 @@ class IBMFCompiler(FCompiler): log.info('Creating '+new_cfg) fi = open(xlf_cfg,'r') crt1_match = re.compile(r'\s*crt\s*[=]\s*(?P<path>.*)/crt1.o').match - for line in fi.readlines(): + for line in fi: m = crt1_match(line) if m: fo.write('crt = %s/bundle1.o\n' % (m.group('path'))) diff --git a/numpy/distutils/from_template.py b/numpy/distutils/from_template.py index 1bb7a0a27..99f36e371 100644 --- a/numpy/distutils/from_template.py +++ b/numpy/distutils/from_template.py @@ -209,7 +209,7 @@ def resolve_includes(source): d = os.path.dirname(source) fid = open(source) lines = [] - for line in fid.readlines(): + for line in fid: m = include_src_re.match(line) if m: fn = m.group('name') diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py index c22aacb9a..556668264 100644 --- a/numpy/distutils/misc_util.py +++ b/numpy/distutils/misc_util.py @@ -167,7 +167,7 @@ def get_mathlibs(path=None): fid = open(config_file) mathlibs = [] s = '#define MATHLIB' - for line in fid.readlines(): + for line in fid: if line.startswith(s): value = line[len(s):].strip() if value: @@ -394,8 +394,7 @@ def _get_f90_modules(source): return [] modules = [] f = open(source,'r') - f_readlines = getattr(f,'xreadlines',f.readlines) - for line in f_readlines(): + for line in f: m = f90_module_name_match(line) if m: name = m.group('name') diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 1f3ce2ddb..869bd6bd1 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -904,7 +904,7 @@ class mkl_info(system_info): paths = os.environ.get('LD_LIBRARY_PATH', '').split(os.pathsep) ld_so_conf = '/etc/ld.so.conf' if os.path.isfile(ld_so_conf): - for d in open(ld_so_conf, 'r').readlines(): + for d in open(ld_so_conf, 'r'): d = d.strip() if d: paths.append(d) |