mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix for IOError unpack crash
This commit is contained in:
parent
91f0ffed00
commit
dbe9ec8337
@ -937,14 +937,20 @@ class TaskManager:
|
|||||||
self.step()
|
self.step()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
self.stop()
|
self.stop()
|
||||||
except IOError, (errno, strerror):
|
except IOError, v:
|
||||||
|
# IOError unpack from http://www.python.org/doc/essays/stdexceptions/
|
||||||
|
try:
|
||||||
|
(code, message) = v
|
||||||
|
except:
|
||||||
|
code = 0
|
||||||
|
message = v
|
||||||
# Since upgrading to Python 2.4.1, pausing the execution
|
# Since upgrading to Python 2.4.1, pausing the execution
|
||||||
# often gives this IOError during the sleep function:
|
# often gives this IOError during the sleep function:
|
||||||
# IOError: [Errno 4] Interrupted function call
|
# IOError: [Errno 4] Interrupted function call
|
||||||
# So, let's just handle that specific exception and stop.
|
# So, let's just handle that specific exception and stop.
|
||||||
# All other IOErrors should still get raised.
|
# All other IOErrors should still get raised.
|
||||||
# Only problem: legit IOError 4s will be obfuscated.
|
# Only problem: legit IOError 4s will be obfuscated.
|
||||||
if errno == 4:
|
if code == 4:
|
||||||
self.stop()
|
self.stop()
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
Loading…
x
Reference in New Issue
Block a user