Author xiang.zhang
Recipients Romuald, abarry, berker.peksag, davin, pitrou, r.david.murray, vstinner, xiang.zhang, ztane
Date 2016-07-18.15:30:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1468855802.29.0.993665741726.issue27558@psf.upfronthosting.co.za>
In-reply-to
Content
A simple try ... except ... can set the variable to Py_None:

>>> import threading
>>> def foo():
...     try:
...             raise RuntimeError
...     except:
...             pass
...     raise
... 
>>> threading.Thread(target=foo).start()
>>> Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "<stdin>", line 6, in foo
RuntimeError: No active exception to reraise

In the startup procedure, some c-apis are called and there are patterns like:

try:
    import some_module
except ImportError:
    some_module = ...

So I think after startup the variable can't be NULL. But we do see a NULL case here.
History
Date User Action Args
2016-07-18 15:30:02xiang.zhangsetrecipients: + xiang.zhang, pitrou, vstinner, r.david.murray, berker.peksag, ztane, Romuald, davin, abarry
2016-07-18 15:30:02xiang.zhangsetmessageid: <1468855802.29.0.993665741726.issue27558@psf.upfronthosting.co.za>
2016-07-18 15:30:02xiang.zhanglinkissue27558 messages
2016-07-18 15:30:02xiang.zhangcreate