[reader] py3k removed execfile

Related to #267910.

authorJulien Cristau <julien.cristau@logilab.fr>
changeset189b9a1ba775
branchdefault
phasepublic
hiddenno
parent revision#1eba2a7d0f1d [reader] don't use 3-expr raise syntax
child revision#3078efd1abb0 [exceptions] don't use dict.iteritems
files modified by this revision
reader.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1413453178 -7200
# Thu Oct 16 11:52:58 2014 +0200
# Node ID 189b9a1ba775f48d59c1d57e53c8b4c0396f7e21
# Parent 1eba2a7d0f1dbc0ccfdd1e61182a97f0597d5983
[reader] py3k removed execfile

Related to #267910.

diff --git a/reader.py b/reader.py
@@ -255,11 +255,12 @@
1              fglobals['__file__'] = filepath
2              fglobals['__name__'] = modname
3              package = '.'.join(modname.split('.')[:-1])
4              if package and not package in sys.modules:
5                  __import__(package)
6 -            execfile(filepath, fglobals)
7 +            with open(filepath) as f:
8 +                exec(f.read(), fglobals)
9              # check for use of classes that should be imported, without
10              # importing them
11              for name, obj in fglobals.items():
12                  if isinstance(obj, type) and \
13                         issubclass(obj, buildobjs.Definition) and \