diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-04-30 14:04:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-30 14:04:57 (GMT) |
commit | 9746cda705decebc0ba572d95612796afd06dcd4 (patch) | |
tree | d21d7082061099687919b8e744250bb39cf5613d /Lib/test/test_curses.py | |
parent | 387397f8a4244c983f4568c16a28842e3268fe5d (diff) | |
download | cpython-9746cda705decebc0ba572d95612796afd06dcd4.zip cpython-9746cda705decebc0ba572d95612796afd06dcd4.tar.gz cpython-9746cda705decebc0ba572d95612796afd06dcd4.tar.bz2 |
bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748)
Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to the following types:
* _dbm.dbm
* _gdbm.gdbm
* _multibytecodec.MultibyteCodec
* _sre..SRE_Scanner
* _thread._localdummy
* _thread.lock
* _winapi.Overlapped
* array.arrayiterator
* functools.KeyWrapper
* functools._lru_list_elem
* pyexpat.xmlparser
* re.Match
* re.Pattern
* unicodedata.UCD
* zlib.Compress
* zlib.Decompress
Diffstat (limited to 'Lib/test/test_curses.py')
-rw-r--r-- | Lib/test/test_curses.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index 280a9dc..8bf48a6 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -6,7 +6,7 @@ import sys import tempfile import unittest -from test.support import requires, verbose, SaveSignals +from test.support import requires, verbose, SaveSignals, cpython_only from test.support.import_helper import import_module # Optionally test curses module. This currently requires that the @@ -1046,8 +1046,10 @@ class TestCurses(unittest.TestCase): panel.set_userptr(A()) panel.set_userptr(None) + @cpython_only @requires_curses_func('panel') - def test_new_curses_panel(self): + def test_disallow_instantiation(self): + # Ensure that the type disallows instantiation (bpo-43916) w = curses.newwin(10, 10) panel = curses.panel.new_panel(w) self.assertRaises(TypeError, type(panel)) |