]> granicus.if.org Git - python/commitdiff
Fix test failures when Python is compiled without thread support.
authorNadeem Vawda <nadeem.vawda@gmail.com>
Mon, 29 Aug 2011 07:37:07 +0000 (09:37 +0200)
committerNadeem Vawda <nadeem.vawda@gmail.com>
Mon, 29 Aug 2011 07:37:07 +0000 (09:37 +0200)
Lib/trace.py

index 6e15e8b4bd866a09f27bdd7a38c4dce628f3e306..38a13e2a9f0fa92ddcfec3c92022c355a3a4a943 100644 (file)
@@ -502,15 +502,7 @@ class Trace:
     def run(self, cmd):
         import __main__
         dict = __main__.__dict__
-        if not self.donothing:
-            threading.settrace(self.globaltrace)
-            sys.settrace(self.globaltrace)
-        try:
-            exec cmd in dict, dict
-        finally:
-            if not self.donothing:
-                sys.settrace(None)
-                threading.settrace(None)
+        self.runctx(cmd, dict, dict)
 
     def runctx(self, cmd, globals=None, locals=None):
         if globals is None: globals = {}