odd runtime error
- From: David Brown <dmlb2000@xxxxxxxxx>
- Date: Wed, 1 Dec 2010 16:49:30 -0800
So I'm not subscribed to python-list but would like to get an answer
to my question. I've made a small test program that dumps a
RuntimeError and I'd like to know why.
$ python test2.py
Traceback (most recent call last):
File "test2.py", line 3, in <module>
RuntimeError: not holding the import lock
child 3693 exited with 256
Here's the setup, there's two files test.py and test2.py
$ cat test.py
import os, sys
if os.fork() == 0:
print "doing stuff"
print "child %d exited with %d" % os.wait()
$ cat test2.py
I understand that sys.exit() is really just doing a `raise
SystemExit(0)' and the RuntimeError shows up with that as well. If you
change out sys.exit with os._exit(0) then it doesn't show dump the
RuntimeError. Also, this seems to be a python2.6 and python2.7 issue.
Python3 doesn't have this issue. I haven't checked with python2.5 or
I was more curious about what this behavior is and why python is doing
things this way. I've scoured the python documentation and can't seem
to figure out why.
- David Brown
- Prev by Date: I can't seem to change the timeout value on pexpect
- Next by Date: Re: odd runtime error
- Previous by thread: I can't seem to change the timeout value on pexpect
- Next by thread: Re: odd runtime error