Show More
@@ -68,9 +68,13 b' def test_user_setup():' | |||||
68 | # Now repeat the operation with a non-existent directory. Check both that |
|
68 | # Now repeat the operation with a non-existent directory. Check both that | |
69 | # the call succeeds and that the directory is created. |
|
69 | # the call succeeds and that the directory is created. | |
70 | tmpdir = tempfile.mktemp(prefix='ipython-test-') |
|
70 | tmpdir = tempfile.mktemp(prefix='ipython-test-') | |
|
71 | # Use a try with an empty except because try/finally doesn't work with a | |||
|
72 | # yield in Python 2.4. | |||
71 | try: |
|
73 | try: | |
72 | yield user_setup, (tmpdir,''), kw |
|
74 | yield user_setup, (tmpdir,''), kw | |
73 | yield os.path.isdir, tmpdir |
|
75 | yield os.path.isdir, tmpdir | |
74 | finally: |
|
76 | except: | |
75 | # In this case, clean up the temp dir once done |
|
77 | pass | |
76 | shutil.rmtree(tmpdir) |
|
78 | # Clean up the temp dir once done | |
|
79 | shutil.rmtree(tmpdir) | |||
|
80 | No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now