[Numpy-discussion] py3k execfile('setup.py')

Ralf Gommers ralf.gommers@googlemail....
Thu Jul 29 10:39:19 CDT 2010


The execfile builtin has disappeared in python 3.x, so I'm trying to find
another solution for the use of it in setupegg.py. So far I've tried

if sys.version_info[0] >= 3:
    # 3.x doesn't have execfile anymore, so we define our own
    # The code below is syntactically valid 2.x, but 2.x thinks that a tuple
    # gets passed to the exec statement. (from Twisted)
    def execfile(filename, globals=None, locals=None):
        exec(compile(open(filename).read(), filename, 'exec'), globals,


if sys.version_info[0] >= 3:
    import imp
    setupfile = imp.load_source('setupfile', 'setup.py')

Both of the above attempts hang at:
$ paver dmg -p 3.1
---> pavement.dmg
---> pavement.clean
LDFLAGS='-undefined dynamic_lookup -bundle -arch i386 -arch ppc
-Wl,-search_paths_first -Lbuild'
/Library/Frameworks/Python.framework/Versions/3.1/bin/python3 setupegg.py
Converting to Python3 via 2to3...

Looks like the combination of setuptools, numpy.distutils and 2to3 is too
much for me to wrap my head around. Anyone have an idea?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100729/57bb8ac9/attachment.html 

More information about the NumPy-Discussion mailing list