From: Nadeem Vawda Date: Mon, 29 Aug 2011 07:37:07 +0000 (+0200) Subject: Fix test failures when Python is compiled without thread support. X-Git-Tag: v2.7.3rc1~481 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66e53c70d79dc4ddff8066f2351cd7e085c1a16b;p=python Fix test failures when Python is compiled without thread support. --- diff --git a/Lib/trace.py b/Lib/trace.py index 6e15e8b4bd..38a13e2a9f 100644 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -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 = {}