summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-07 04:48:24 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-07 04:48:24 (GMT)
commit60da31660c6a74fea15dfc93f3b3c16ce4619539 (patch)
treeb95ea57e737ea98604e9b8401edcf50968f0dee7 /Lib
parente22373d69011e719aa92837822e9a35157e20e8c (diff)
downloadcpython-60da31660c6a74fea15dfc93f3b3c16ce4619539.zip
cpython-60da31660c6a74fea15dfc93f3b3c16ce4619539.tar.gz
cpython-60da31660c6a74fea15dfc93f3b3c16ce4619539.tar.bz2
Thanks to Coverity, these were all reported by their Prevent tool.
All of these (except _lsprof.c) should be backported. Particularly the hotshot change which validates sys.path. Can someone backport?
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_hotshot.py13
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)