diff options
author | Thomas Wouters <thomas@python.org> | 2006-03-07 12:08:42 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-03-07 12:08:42 (GMT) |
commit | e34fc700fcdf0587592f3ccfb2caf5d474ac952a (patch) | |
tree | 3cbfa8d310165ac8e54a670ae8f86244c470896c /Lib | |
parent | a4b4dc328f0769f90c3ebb743280b48d4eae7b7c (diff) | |
download | cpython-e34fc700fcdf0587592f3ccfb2caf5d474ac952a.zip cpython-e34fc700fcdf0587592f3ccfb2caf5d474ac952a.tar.gz cpython-e34fc700fcdf0587592f3ccfb2caf5d474ac952a.tar.bz2 |
Backport trunk's r42878 (neal.norwitz):
Thanks to Coverity, these were all reported by their Prevent tool.
and r42881 (thomas.wouters):
Don't DECREF a borrowed reference.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_hotshot.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_hotshot.py b/Lib/test/test_hotshot.py index 721da57..4618439 100644 --- a/Lib/test/test_hotshot.py +++ b/Lib/test/test_hotshot.py @@ -107,6 +107,19 @@ class HotShotTestCase(unittest.TestCase): profiler.close() os.unlink(self.logfn) + def test_bad_sys_path(self): + import sys + orig_path = sys.path + coverage = hotshot._hotshot.coverage + try: + # verify we require a list for sys.path + sys.path = 'abc' + self.assertRaises(RuntimeError, coverage, test_support.TESTFN) + # verify sys.path exists + del sys.path + self.assertRaises(RuntimeError, coverage, test_support.TESTFN) + finally: + sys.path = orig_path def test_main(): test_support.run_unittest(HotShotTestCase) |