Permalink
Browse files

sys._getframe shouldn't be needed when running unit-tests in IronPython.

  • Loading branch information...
1 parent e4edc44 commit d5d262dbcd0c126ec0ec37e116ff79575c5dd6d8 @fabioz fabioz committed Apr 22, 2011
@@ -7,6 +7,12 @@
except:
from queue import Queue
+#This may happen in IronPython (in Python it shouldn't happen as there are
+#'fast' replacements that are used in xmlrpclib.py)
+import warnings
+warnings.filterwarnings(
+ 'ignore', 'The xmllib module is obsolete.*', DeprecationWarning)
+
#=======================================================================================================================
@@ -159,16 +159,16 @@ def set_pm_excepthook(handle_exceptions=None):
'''
Should be called to register the excepthook to be used.
- It's only useful for uncaucht exceptions. I.e.: exceptions that go up to the excepthook.
+ It's only useful for uncaught exceptions. I.e.: exceptions that go up to the excepthook.
Can receive a parameter to stop only on some exceptions.
E.g.:
- register_excepthook((IndexError, ValueError))
+ set_pm_excepthook((IndexError, ValueError))
or
- register_excepthook(IndexError)
+ set_pm_excepthook(IndexError)
if passed without a parameter, will break on any exception
@@ -25,7 +25,11 @@ class DebugInfoHolder:
#Hold a reference to the original _getframe (because psyco will change that as soon as it's imported)
import sys #Note: the sys import must be here anyways (others depend on it)
-GetFrame = sys._getframe
+try:
+ GetFrame = sys._getframe
+except AttributeError:
+ def GetFrame():
+ raise AssertionError('sys._getframe not available (possible causes: enable -X:Frames on IronPython?)')
#Used to determine the maximum size of each variable passed to eclipse -- having a big value here may make
#the communication slower -- as the variables are being gathered lazily in the latest version of eclipse,

0 comments on commit d5d262d

Please sign in to comment.