Commit bd34c9af authored by Robert Bradshaw's avatar Robert Bradshaw

Restore cwd if debugger setUp() fails (to avoid breaking later tests).

parent d6e9ff9c
...@@ -90,6 +90,7 @@ class DebuggerTestCase(unittest.TestCase): ...@@ -90,6 +90,7 @@ class DebuggerTestCase(unittest.TestCase):
self.cfuncs_destfile = os.path.join(self.tempdir, 'cfuncs') self.cfuncs_destfile = os.path.join(self.tempdir, 'cfuncs')
self.cwd = os.getcwd() self.cwd = os.getcwd()
try:
os.chdir(self.tempdir) os.chdir(self.tempdir)
shutil.copy(codefile, self.destfile) shutil.copy(codefile, self.destfile)
...@@ -145,6 +146,10 @@ class DebuggerTestCase(unittest.TestCase): ...@@ -145,6 +146,10 @@ class DebuggerTestCase(unittest.TestCase):
# cmdclass=dict(build_ext=Cython.Distutils.build_ext) # cmdclass=dict(build_ext=Cython.Distutils.build_ext)
# ) # )
except:
os.chdir(self.cwd)
raise
def tearDown(self): def tearDown(self):
if not test_gdb(): if not test_gdb():
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment