mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix for IOError unpacking
This commit is contained in:
parent
f23a0b0126
commit
6f96c57f8b
@ -937,13 +937,8 @@ class TaskManager:
|
|||||||
self.step()
|
self.step()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
self.stop()
|
self.stop()
|
||||||
except IOError, v:
|
except IOError, ioError:
|
||||||
# IOError unpack from http://www.python.org/doc/essays/stdexceptions/
|
code, message = self._unpackIOError(ioError)
|
||||||
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
|
||||||
@ -961,6 +956,17 @@ class TaskManager:
|
|||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
def _unpackIOError(self, ioError):
|
||||||
|
# IOError unpack from http://www.python.org/doc/essays/stdexceptions/
|
||||||
|
# this needs to be in its own method, exceptions that occur inside
|
||||||
|
# a nested try block are not caught by the inner try block's except
|
||||||
|
try:
|
||||||
|
(code, message) = ioError
|
||||||
|
except:
|
||||||
|
code = 0
|
||||||
|
message = ioError
|
||||||
|
return code, message
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
# Set a flag so we will stop before beginning next frame
|
# Set a flag so we will stop before beginning next frame
|
||||||
self.running = 0
|
self.running = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user