Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ada3d6

Browse files
committed
Merge trunk up to 43069, putting re.py back and hopefully making the branch
usable again.
1 parent 725ccd1 commit 9ada3d6

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

File renamed without changes.

Lib/test/regrtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
import getopt
111111
import random
112112
import warnings
113-
import sre
113+
import re
114114
import cStringIO
115115
import traceback
116116

@@ -525,7 +525,7 @@ def cleanup():
525525
_path_created.clear()
526526
warnings.filters[:] = fs
527527
gc.collect()
528-
sre.purge()
528+
re.purge()
529529
_strptime._regex_cache.clear()
530530
urlparse.clear_cache()
531531
urllib.urlcleanup()

Lib/test/test___all__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ def test_all(self):
145145
self.check_all("smtplib")
146146
self.check_all("sndhdr")
147147
self.check_all("socket")
148-
self.check_all("sre")
149148
self.check_all("_strptime")
150149
self.check_all("symtable")
151150
self.check_all("tabnanny")

Lib/test/test_re.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from test.test_support import verbose, run_unittest
55
import re
6-
from sre import Scanner
6+
from re import Scanner
77
import sys, os, traceback
88
from weakref import proxy
99

Modules/_sre.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ static char copyright[] =
5151
#define SRE_MODULE "sre"
5252
#endif
5353

54+
#define SRE_PY_MODULE "re"
55+
5456
/* defining this one enables tracing */
5557
#undef VERBOSE
5658

@@ -2455,7 +2457,7 @@ pattern_subx(PatternObject* self, PyObject* template, PyObject* string,
24552457
} else {
24562458
/* not a literal; hand it over to the template compiler */
24572459
filter = call(
2458-
SRE_MODULE, "_subx",
2460+
SRE_PY_MODULE, "_subx",
24592461
PyTuple_Pack(2, self, template)
24602462
);
24612463
if (!filter)
@@ -2872,7 +2874,7 @@ match_expand(MatchObject* self, PyObject* args)
28722874

28732875
/* delegate to Python code */
28742876
return call(
2875-
SRE_MODULE, "_expand",
2877+
SRE_PY_MODULE, "_expand",
28762878
PyTuple_Pack(3, self->pattern, self, template)
28772879
);
28782880
}

0 commit comments

Comments
 (0)