Browse files

Merge branch 'master' of github.com:geocam/geocamPycroCom

  • Loading branch information...
2 parents 51493f6 + b2558ce commit badfc23e5f50ea3b70721b4cad9af3594d183521 Dave Jackson committed Jul 28, 2011
Showing with 14 additions and 4 deletions.
  1. +14 −4 geocamPycroCom/printTraceback.py
View
18 geocamPycroCom/printTraceback.py
@@ -6,12 +6,22 @@
import sys
import traceback
+import errno
+import time
def printTraceback():
errClass, errObj, errTB = sys.exc_info()[:3]
- traceback.print_tb(errTB)
- print >>sys.stderr, '%s.%s: %s' % (errClass.__module__,
- errClass.__name__,
- str(errObj))
+ while 1:
+ try:
+ traceback.print_tb(errTB)
+ print >>sys.stderr, '%s.%s: %s' % (errClass.__module__,
+ errClass.__name__,
+ str(errObj))
+ break
+ except IOError, exc:
+ if exc.args[0] == errno.EAGAIN:
+ time.sleep(0.1)
+ else:
+ raise
if isinstance(errObj, KeyboardInterrupt):
sys.exit(0)

0 comments on commit badfc23

Please sign in to comment.