From: Neal Norwitz Date: Sun, 24 Aug 2008 22:07:28 +0000 (+0000) Subject: Merged revisions 66018 via svnmerge from X-Git-Tag: v3.0rc1~175 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e0e0e6749f4e68a9a2d13c4935d1e39546c8114;p=python Merged revisions 66018 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r66018 | neal.norwitz | 2008-08-24 15:03:05 -0700 (Sun, 24 Aug 2008) | 6 lines #3662: Fix segfault introduced when fixing memory leaks. TESTED=./python -E -tt ./Lib/test/regrtest.py test_fileio R (approach from bug)=Amaury and Benjamin ........ --- diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index 12b8e7da31..a676bc2118 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -226,6 +226,10 @@ class OtherFileTests(unittest.TestCase): except: pass + def testInvalidInit(self): + self.assertRaises(TypeError, _fileio._FileIO, "1", 0, 0) + + def test_main(): # Historically, these tests have been sloppy about removing TESTFN. # So get rid of it no matter what. diff --git a/Modules/_fileio.c b/Modules/_fileio.c index ec123e891e..81ca20227d 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c @@ -175,7 +175,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) kwlist, Py_FileSystemDefaultEncoding, &name, &mode, &closefd)) - goto error; + return -1; } }