File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -219,11 +219,16 @@ def testSeekPreStart(self):
219219 bz2f .close ()
220220
221221 def testOpenDel (self ):
222+ # "Test opening and deleting a file many times"
222223 self .createTempFile ()
223224 for i in xrange (10000 ):
224225 o = BZ2File (self .filename )
225226 del o
226227
228+ def testOpenNonexistent (self ):
229+ # "Test opening a nonexistent file"
230+ self .assertRaises (IOError , BZ2File , "/non/existent" )
231+
227232class BZ2CompressorTest (BaseTest ):
228233 def testCompress (self ):
229234 # "Test BZ2Compressor.compress()/flush()"
Original file line number Diff line number Diff line change @@ -1388,7 +1388,7 @@ BZ2File_dealloc(BZ2FileObject *self)
13881388 break ;
13891389 }
13901390 Util_DropReadAhead (self );
1391- Py_DECREF (self -> file );
1391+ Py_XDECREF (self -> file );
13921392 self -> ob_type -> tp_free ((PyObject * )self );
13931393}
13941394
You can’t perform that action at this time.
0 commit comments