diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2019-09-11 12:39:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-11 12:39:52 (GMT) |
commit | 3b92ddb7612fd8fe2be95ff3d8022ed18335b13f (patch) | |
tree | 85461b4f2e4f6448b1bdb7cdca4895c61173ebde /Lib/test/test_shlex.py | |
parent | 01ae0e269899c244c6cf779dc3a7ebdd29248859 (diff) | |
download | cpython-3b92ddb7612fd8fe2be95ff3d8022ed18335b13f.zip cpython-3b92ddb7612fd8fe2be95ff3d8022ed18335b13f.tar.gz cpython-3b92ddb7612fd8fe2be95ff3d8022ed18335b13f.tar.bz2 |
[3.8] bpo-35168: Make shlex.punctuation_chars read-only (GH-11631) (GH-15927)
(cherry picked from commit 972cf5c06a5ba16ad243a442dbb9c15307fbed95)
Co-authored-by: Alex <a.v.shkop@gmail.com>
Diffstat (limited to 'Lib/test/test_shlex.py')
-rw-r--r-- | Lib/test/test_shlex.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_shlex.py b/Lib/test/test_shlex.py index 376c5e8..a21ccd2 100644 --- a/Lib/test/test_shlex.py +++ b/Lib/test/test_shlex.py @@ -353,6 +353,13 @@ class ShlexTest(unittest.TestCase): resplit = shlex.split(joined) self.assertEqual(split_command, resplit) + def testPunctuationCharsReadOnly(self): + punctuation_chars = "/|$%^" + shlex_instance = shlex.shlex(punctuation_chars=punctuation_chars) + self.assertEqual(shlex_instance.punctuation_chars, punctuation_chars) + with self.assertRaises(AttributeError): + shlex_instance.punctuation_chars = False + # Allow this test to be used with old shlex.py if not getattr(shlex, "split", None): |