[pypy-issue] [issue1514] module behaviour incompatibility which makes eventlet fail

YAMAMOTO Takashi tracker at bugs.pypy.org
Tue Jun 11 09:14:12 CEST 2013


New submission from YAMAMOTO Takashi <yamt at mwd.biglobe.ne.jp>:

the following code behaves differently on cpython and pypy.
it breaks eventlet monkey pathcing.

---------------

import select
import sys

f = select.select
setattr(select, 'select', None)
assert f != select.select

# save, re-import, restore.
# this is essentially what eventlet.patcher does.
modname = 'select'
saved = sys.modules.get(modname)
sys.modules.pop(modname)
__import__(modname)
sys.modules[modname] = saved

assert f != select.select  # this succeeds on cpython but fails on pypy.

----------
messages: 5843
nosy: pypy-issue, yamt
priority: bug
status: unread
title: module behaviour incompatibility which makes eventlet fail

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1514>
________________________________________


More information about the pypy-issue mailing list