Skip to content

Commit 1578f06

Browse files
bpo-47152: Move sources of the _sre module into a subdirectory (GH-32290)
1 parent 4216dce commit 1578f06

File tree

13 files changed

+26
-24
lines changed

13 files changed

+26
-24
lines changed

Lib/re/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def dump(f, d, prefix):
234234
*
235235
* Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
236236
*
237-
* See the _sre.c file for information on usage and redistribution.
237+
* See the sre.c file for information on usage and redistribution.
238238
*/
239239
240240
""")

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ Programs/python.o: $(srcdir)/Programs/python.c
12261226
Programs/_testembed.o: $(srcdir)/Programs/_testembed.c Programs/test_frozenmain.h
12271227
$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c
12281228

1229-
Modules/_sre.o: $(srcdir)/Modules/_sre.c $(srcdir)/Modules/sre.h $(srcdir)/Modules/sre_constants.h $(srcdir)/Modules/sre_lib.h
1229+
Modules/_sre/sre.o: $(srcdir)/Modules/_sre/sre.c $(srcdir)/Modules/_sre/sre.h $(srcdir)/Modules/_sre/sre_constants.h $(srcdir)/Modules/_sre/sre_lib.h
12301230

12311231
Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
12321232

Modules/Setup.bootstrap.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ _collections _collectionsmodule.c
1818
errno errnomodule.c
1919
_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
2020
itertools itertoolsmodule.c
21-
_sre _sre.c
21+
_sre _sre/sre.c
2222
_thread _threadmodule.c
2323
time timemodule.c
2424
_weakref _weakref.c
File renamed without changes.

Modules/_sre.c renamed to Modules/_sre/sre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2788,7 +2788,7 @@ pattern_richcompare(PyObject *lefto, PyObject *righto, int op)
27882788
return PyBool_FromLong(cmp);
27892789
}
27902790

2791-
#include "clinic/_sre.c.h"
2791+
#include "clinic/sre.c.h"
27922792

27932793
static PyMethodDef pattern_methods[] = {
27942794
_SRE_SRE_PATTERN_MATCH_METHODDEF

Modules/sre.h renamed to Modules/_sre/sre.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
77
*
8-
* See the _sre.c file for information on usage and redistribution.
8+
* See the sre.c file for information on usage and redistribution.
99
*/
1010

1111
#ifndef SRE_INCLUDED

Modules/sre_constants.h renamed to Modules/_sre/sre_constants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
1010
*
11-
* See the _sre.c file for information on usage and redistribution.
11+
* See the sre.c file for information on usage and redistribution.
1212
*/
1313

1414
#define SRE_MAGIC 20220402

Modules/sre_lib.h renamed to Modules/_sre/sre_lib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
77
*
8-
* See the _sre.c file for information on usage and redistribution.
8+
* See the sre.c file for information on usage and redistribution.
99
*/
1010

1111
/* String matching engine */

PCbuild/pythoncore.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,6 @@
296296
<ClInclude Include="..\Modules\_math.h" />
297297
<ClInclude Include="..\Modules\hashtable.h" />
298298
<ClInclude Include="..\Modules\rotatingtree.h" />
299-
<ClInclude Include="..\Modules\sre.h" />
300-
<ClInclude Include="..\Modules\sre_constants.h" />
301-
<ClInclude Include="..\Modules\sre_lib.h" />
302299
<ClInclude Include="..\Modules\_io\_iomodule.h" />
303300
<ClInclude Include="..\Modules\cjkcodecs\alg_jisx0201.h" />
304301
<ClInclude Include="..\Modules\cjkcodecs\cjkcodecs.h" />
@@ -359,7 +356,10 @@
359356
<ClCompile Include="..\Modules\_pickle.c" />
360357
<ClCompile Include="..\Modules\_randommodule.c" />
361358
<ClCompile Include="..\Modules\_sha3\sha3module.c" />
362-
<ClCompile Include="..\Modules\_sre.c" />
359+
<ClCompile Include="..\Modules\_sre\sre.c" />
360+
<ClInclude Include="..\Modules\_sre\sre.h" />
361+
<ClInclude Include="..\Modules\_sre\sre_constants.h" />
362+
<ClInclude Include="..\Modules\_sre\sre_lib.h" />
363363
<ClCompile Include="..\Modules\_stat.c" />
364364
<ClCompile Include="..\Modules\_struct.c" />
365365
<ClCompile Include="..\Modules\_weakref.c" />

PCbuild/pythoncore.vcxproj.filters

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,6 @@
240240
<ClInclude Include="..\Modules\rotatingtree.h">
241241
<Filter>Modules</Filter>
242242
</ClInclude>
243-
<ClInclude Include="..\Modules\sre.h">
244-
<Filter>Modules</Filter>
245-
</ClInclude>
246-
<ClInclude Include="..\Modules\sre_constants.h">
247-
<Filter>Modules</Filter>
248-
</ClInclude>
249-
<ClInclude Include="..\Modules\sre_lib.h">
250-
<Filter>Modules</Filter>
251-
</ClInclude>
252243
<ClInclude Include="..\Modules\_io\_iomodule.h">
253244
<Filter>Modules\_io</Filter>
254245
</ClInclude>
@@ -731,9 +722,18 @@
731722
<ClCompile Include="..\Modules\_sha3\sha3module.c">
732723
<Filter>Modules</Filter>
733724
</ClCompile>
734-
<ClCompile Include="..\Modules\_sre.c">
725+
<ClCompile Include="..\Modules\_sre\sre.c">
735726
<Filter>Modules</Filter>
736727
</ClCompile>
728+
<ClInclude Include="..\Modules\_sre\sre.h">
729+
<Filter>Modules</Filter>
730+
</ClInclude>
731+
<ClInclude Include="..\Modules\_sre\sre_constants.h">
732+
<Filter>Modules</Filter>
733+
</ClInclude>
734+
<ClInclude Include="..\Modules\_sre\sre_lib.h">
735+
<Filter>Modules</Filter>
736+
</ClInclude>
737737
<ClCompile Include="..\Modules\_statisticsmodule.c">
738738
<Filter>Modules</Filter>
739739
</ClCompile>

Tools/c-analyzer/cpython/_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def clean_lines(text):
148148
Modules/_localemodule.c Py_BUILD_CORE 1
149149
Modules/_operator.c Py_BUILD_CORE 1
150150
Modules/_posixsubprocess.c Py_BUILD_CORE 1
151-
Modules/_sre.c Py_BUILD_CORE 1
151+
Modules/_sre/sre.c Py_BUILD_CORE 1
152152
Modules/_threadmodule.c Py_BUILD_CORE 1
153153
Modules/_tracemalloc.c Py_BUILD_CORE 1
154154
Modules/_weakref.c Py_BUILD_CORE 1
@@ -262,8 +262,8 @@ def clean_lines(text):
262262
Modules/_dbmmodule.c HAVE_GDBM_DASH_NDBM_H 1
263263
264264
# others
265-
Modules/sre_lib.h LOCAL(type) static inline type
266-
Modules/sre_lib.h SRE(F) sre_ucs2_##F
265+
Modules/_sre/sre_lib.h LOCAL(type) static inline type
266+
Modules/_sre/sre_lib.h SRE(F) sre_ucs2_##F
267267
Objects/stringlib/codecs.h STRINGLIB_IS_UNICODE 1
268268
Include/internal/pycore_bitutils.h _Py__has_builtin(B) 0
269269

configure

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5992,6 +5992,7 @@ SRCDIRS="\
59925992
Modules/_multiprocessing \
59935993
Modules/_sha3 \
59945994
Modules/_sqlite \
5995+
Modules/_sre \
59955996
Modules/_xxtestfuzz \
59965997
Modules/cjkcodecs \
59975998
Modules/expat \

0 commit comments

Comments
 (0)