Kaydet (Commit) 71b2ded0 authored tarafından Terry Jan Reedy's avatar Terry Jan Reedy

Silence deprecation warning in test_mmap for ValueError.message.

Replacement is from 3.3, with 'p' added to make '...Regexp'.
üst 0c534a46
...@@ -470,14 +470,10 @@ class MmapTests(unittest.TestCase): ...@@ -470,14 +470,10 @@ class MmapTests(unittest.TestCase):
f = open (TESTFN, 'w+b') f = open (TESTFN, 'w+b')
f.close() f.close()
with open(TESTFN, "rb") as f : with open(TESTFN, "rb") as f :
try: self.assertRaisesRegexp(ValueError,
m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) "cannot mmap an empty file",
m.close() mmap.mmap, f.fileno(), 0,
self.fail("should not have been able to mmap empty file") access=mmap.ACCESS_READ)
except ValueError as e:
self.assertEqual(e.message, "cannot mmap an empty file")
except:
self.fail("unexpected exception: " + str(e))
def test_offset (self): def test_offset (self):
f = open (TESTFN, 'w+b') f = open (TESTFN, 'w+b')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment