Skip to content

Commit 5fa0085

Browse files
Remove sre_modules
1 parent ffb2a02 commit 5fa0085

File tree

10 files changed

+16
-58
lines changed

10 files changed

+16
-58
lines changed

Doc/deprecations/pending-removal-in-3.15.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ Pending removal in Python 3.15
9797
After eight years in the :mod:`typing` module,
9898
it has yet to be supported by any major type checker.
9999

100+
* :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules.
101+
100102
* :mod:`wave`:
101103

102104
* The ``getmark()``, ``setmark()`` and ``getmarkers()`` methods of

Doc/deprecations/pending-removal-in-future.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ although there is currently no date scheduled for their removal.
8989
underscore.
9090
(Contributed by Serhiy Storchaka in :gh:`91760`.)
9191

92-
* :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules.
93-
9492
* :mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in
9593
Python 3.12; use the *onexc* parameter instead.
9694

Doc/whatsnew/3.15.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ ctypes
225225
(Contributed by Bénédikt Tran in :gh:`133866`.)
226226

227227

228+
sre_*
229+
-----
230+
231+
* Removed :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules.
232+
(Contributed by Stan Ulbrych in :gh:``.)
233+
234+
228235
http.server
229236
-----------
230237

Lib/sre_compile.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

Lib/sre_constants.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

Lib/sre_parse.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

Lib/test/test_pyclbr.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,6 @@ def test_others(self):
246246
# These were once some of the longest modules.
247247
cm('random', ignore=('Random',)) # from _random import Random as CoreGenerator
248248
cm('pickle', ignore=('partial', 'PickleBuffer'))
249-
with warnings.catch_warnings():
250-
warnings.simplefilter('ignore', DeprecationWarning)
251-
cm('sre_parse', ignore=('dump', 'groups', 'pos')) # from sre_constants import *; property
252249
with temporary_main_spec():
253250
cm(
254251
'pdb',

Lib/test/test_re.py

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ def test_flags(self):
14441444
for flag in [re.I, re.M, re.X, re.S, re.A, re.L]:
14451445
self.assertTrue(re.compile(b'^pattern$', flag))
14461446

1447-
def test_sre_character_literals(self):
1447+
def test_character_literals(self):
14481448
for i in [0, 8, 16, 32, 64, 127, 128, 255, 256, 0xFFFF, 0x10000, 0x10FFFF]:
14491449
if i < 256:
14501450
self.assertTrue(re.match(r"\%03o" % i, chr(i)))
@@ -1476,7 +1476,7 @@ def test_sre_character_literals(self):
14761476
self.checkPatternError(r"\U0001234z", r'incomplete escape \U0001234', 0)
14771477
self.checkPatternError(r"\U00110000", r'bad escape \U00110000', 0)
14781478

1479-
def test_sre_character_class_literals(self):
1479+
def test_character_class_literals(self):
14801480
for i in [0, 8, 16, 32, 64, 127, 128, 255, 256, 0xFFFF, 0x10000, 0x10FFFF]:
14811481
if i < 256:
14821482
self.assertTrue(re.match(r"[\%o]" % i, chr(i)))
@@ -1504,7 +1504,7 @@ def test_sre_character_class_literals(self):
15041504
self.checkPatternError(r"[\U00110000]", r'bad escape \U00110000', 1)
15051505
self.assertTrue(re.match(r"[\U0001d49c-\U0001d4b5]", "\U0001d49e"))
15061506

1507-
def test_sre_byte_literals(self):
1507+
def test_byte_literals(self):
15081508
for i in [0, 8, 16, 32, 64, 127, 128, 255]:
15091509
self.assertTrue(re.match((r"\%03o" % i).encode(), bytes([i])))
15101510
self.assertTrue(re.match((r"\%03o0" % i).encode(), bytes([i])+b"0"))
@@ -1525,7 +1525,7 @@ def test_sre_byte_literals(self):
15251525
self.checkPatternError(br"\x1", r'incomplete escape \x1', 0)
15261526
self.checkPatternError(br"\x1z", r'incomplete escape \x1', 0)
15271527

1528-
def test_sre_byte_class_literals(self):
1528+
def test_byte_class_literals(self):
15291529
for i in [0, 8, 16, 32, 64, 127, 128, 255]:
15301530
self.assertTrue(re.match((r"[\%o]" % i).encode(), bytes([i])))
15311531
self.assertTrue(re.match((r"[\%o8]" % i).encode(), bytes([i])))
@@ -2927,33 +2927,6 @@ def test_disallow_instantiation(self):
29272927
pat = re.compile("")
29282928
check_disallow_instantiation(self, type(pat.scanner("")))
29292929

2930-
def test_deprecated_modules(self):
2931-
deprecated = {
2932-
'sre_compile': ['compile', 'error',
2933-
'SRE_FLAG_IGNORECASE', 'SUBPATTERN',
2934-
'_compile_info'],
2935-
'sre_constants': ['error', 'SRE_FLAG_IGNORECASE', 'SUBPATTERN',
2936-
'_NamedIntConstant'],
2937-
'sre_parse': ['SubPattern', 'parse',
2938-
'SRE_FLAG_IGNORECASE', 'SUBPATTERN',
2939-
'_parse_sub'],
2940-
}
2941-
for name in deprecated:
2942-
with self.subTest(module=name):
2943-
sys.modules.pop(name, None)
2944-
with self.assertWarns(DeprecationWarning) as w:
2945-
__import__(name)
2946-
self.assertEqual(str(w.warning),
2947-
f"module {name!r} is deprecated")
2948-
self.assertEqual(w.filename, __file__)
2949-
self.assertIn(name, sys.modules)
2950-
mod = sys.modules[name]
2951-
self.assertEqual(mod.__name__, name)
2952-
self.assertEqual(mod.__package__, '')
2953-
for attr in deprecated[name]:
2954-
self.assertHasAttr(mod, attr)
2955-
del sys.modules[name]
2956-
29572930
@cpython_only
29582931
def test_case_helpers(self):
29592932
import _sre

Lib/test/test_time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ class TestStrftime4dyear(_TestStrftimeYear, _Test4dYear, unittest.TestCase):
756756

757757
class TestPytime(unittest.TestCase):
758758
@skip_if_buggy_ucrt_strfptime
759-
@unittest.skipUnless(time._STRUCT_TM_ITEMS == 11, "needs tm_zone support")
759+
@unittest.skipIf(time.altzone > 0, "System uses negative DST offset")
760760
def test_localtime_timezone(self):
761761

762762
# Get the localtime and examine it for the offset and zone.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Removed :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse`
2+
modules.

0 commit comments

Comments
 (0)