diff options
| author | Martin Panter <vadmium+py@gmail.com> | 2016-11-20 22:17:44 (GMT) |
|---|---|---|
| committer | Martin Panter <vadmium+py@gmail.com> | 2016-11-20 22:17:44 (GMT) |
| commit | 7d6e9232b142cd85a683a195f614bc2f09751934 (patch) | |
| tree | 96937a5367a436b223b9a2610c7c963760560cd5 /Lib | |
| parent | a57890e5ecb164c17b79aa2713758307787eb74b (diff) | |
| parent | 04b35753f7a6bcf50f4a3676aca54cc961b93c83 (diff) | |
| download | cpython-7d6e9232b142cd85a683a195f614bc2f09751934.zip cpython-7d6e9232b142cd85a683a195f614bc2f09751934.tar.gz cpython-7d6e9232b142cd85a683a195f614bc2f09751934.tar.bz2 | |
Issue #25659: Merge ctypes fix from 3.6
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/ctypes/test/test_frombuffer.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_frombuffer.py b/Lib/ctypes/test/test_frombuffer.py index 29c5a19..7ab38f1 100644 --- a/Lib/ctypes/test/test_frombuffer.py +++ b/Lib/ctypes/test/test_frombuffer.py @@ -120,5 +120,13 @@ class Test(unittest.TestCase): with self.assertRaises(ValueError): (c_int * 1).from_buffer_copy(a, 16 * sizeof(c_int)) + def test_abstract(self): + self.assertRaises(TypeError, Array.from_buffer, bytearray(10)) + self.assertRaises(TypeError, Structure.from_buffer, bytearray(10)) + self.assertRaises(TypeError, Union.from_buffer, bytearray(10)) + self.assertRaises(TypeError, Array.from_buffer_copy, b"123") + self.assertRaises(TypeError, Structure.from_buffer_copy, b"123") + self.assertRaises(TypeError, Union.from_buffer_copy, b"123") + if __name__ == '__main__': unittest.main() |
