summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-04-29 06:47:48 (GMT)
committerGitHub <noreply@github.com>2021-04-29 06:47:48 (GMT)
commitc6ad03fddf4b04c60dca4327140e59fb2dcca8e5 (patch)
treee09e51c5cc1d030a83f4b528395875d0ad3631d3 /Lib
parent5daf70b22e72ea1a88c05975f69120b8c4e4927f (diff)
downloadcpython-c6ad03fddf4b04c60dca4327140e59fb2dcca8e5.zip
cpython-c6ad03fddf4b04c60dca4327140e59fb2dcca8e5.tar.gz
cpython-c6ad03fddf4b04c60dca4327140e59fb2dcca8e5.tar.bz2
bpo-43908: Make array.array type immutable (GH-25696)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_array.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index bdcd125..11184ad 100644
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -40,6 +40,12 @@ class MiscTest(unittest.TestCase):
self.assertRaises(TypeError, array.array, 'xx')
self.assertRaises(ValueError, array.array, 'x')
+ @support.cpython_only
+ def test_immutable(self):
+ # bpo-43908: check that array.array is immutable
+ with self.assertRaises(TypeError):
+ array.array.foo = 1
+
def test_empty(self):
# Exercise code for handling zero-length arrays
a = array.array('B')