Skip to content

cython_pyximport reload broken in python3 #3007

juliantaylor opened this Issue Mar 10, 2013 · 2 comments

3 participants


python3.3 notebook, tested in 0.13.1 but the code looks the same in HEAD:

%%cython_pyximport foo
def f(x):
return 4.0*x

execute twice and you get

/usr/lib/python3/dist-packages/IPython/extensions/ in cython_pyximport(self, line, cell)
     99         if module_name in self._reloads:
    100             module = self._reloads[module_name]
--> 101             reload(module)
    102         else:
    103             __import__(module_name)

NameError: global name 'reload' is not defined

imp.reload should be used here


The version of 2to3 in the next release on Python will fix this. In the mean time I guess we'll have to add a workaround.

IPython member
minrk commented Mar 11, 2013

fixed by #3013

@minrk minrk added a commit that closed this issue Mar 11, 2013
@minrk minrk py3 workaround for reload in cythonmagic
closes #3007
@minrk minrk closed this in 72bc759 Mar 11, 2013
@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
@minrk minrk py3 workaround for reload in cythonmagic
closes #3007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.