summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mmap.py
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2018-06-05 12:59:41 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-06-05 12:59:41 (GMT)
commite9e397605789b2a67b67558fbbe756b7b88934f5 (patch)
tree4294134bac41e498ba9f7a889e8b4c8c3791d86a /Lib/test/test_mmap.py
parentaf1ec97a6d1dde68b2dc0ee9b78965eb219061a8 (diff)
downloadcpython-e9e397605789b2a67b67558fbbe756b7b88934f5.zip
cpython-e9e397605789b2a67b67558fbbe756b7b88934f5.tar.gz
cpython-e9e397605789b2a67b67558fbbe756b7b88934f5.tar.bz2
bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381)
Raise TypeError instead of SystemError for unsupported operations.
Diffstat (limited to 'Lib/test/test_mmap.py')
-rw-r--r--Lib/test/test_mmap.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 80835c9..355af8c 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -734,6 +734,13 @@ class MmapTests(unittest.TestCase):
self.assertRaises(ValueError, m.write_byte, 42)
self.assertRaises(ValueError, m.write, b'abc')
+ def test_concat_repeat_exception(self):
+ m = mmap.mmap(-1, 16)
+ with self.assertRaises(TypeError):
+ m + m
+ with self.assertRaises(TypeError):
+ m * 2
+
class LargeMmapTests(unittest.TestCase):