From 94a9c09e109706af64ae8796882baab2af25be2f Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 16 Mar 2006 06:30:02 +0000 Subject: [PATCH] Rename sre.py -> re.py --- Lib/{sre.py => re.py} | 0 Lib/test/regrtest.py | 4 ++-- Lib/test/test___all__.py | 1 - Lib/test/test_re.py | 2 +- Modules/_sre.c | 6 ++++-- 5 files changed, 7 insertions(+), 6 deletions(-) rename Lib/{sre.py => re.py} (100%) diff --git a/Lib/sre.py b/Lib/re.py similarity index 100% rename from Lib/sre.py rename to Lib/re.py diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index b8509129c87..85f57a6c0e0 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -110,7 +110,7 @@ import sys import getopt import random import warnings -import sre +import re import cStringIO import traceback @@ -525,7 +525,7 @@ def runtest(test, generate, verbose, quiet, testdir=None, huntrleaks=False): _path_created.clear() warnings.filters[:] = fs gc.collect() - sre.purge() + re.purge() _strptime._regex_cache.clear() urlparse.clear_cache() urllib.urlcleanup() diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 74a9cdf05b5..0b2e7dae6de 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -145,7 +145,6 @@ class AllTest(unittest.TestCase): self.check_all("smtplib") self.check_all("sndhdr") self.check_all("socket") - self.check_all("sre") self.check_all("_strptime") self.check_all("symtable") self.check_all("tabnanny") diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 9755005f110..14a0acfc6bd 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -3,7 +3,7 @@ sys.path = ['.'] + sys.path from test.test_support import verbose, run_unittest import re -from sre import Scanner +from re import Scanner import sys, os, traceback from weakref import proxy diff --git a/Modules/_sre.c b/Modules/_sre.c index 413ae09af50..bd8f8908ba7 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -51,6 +51,8 @@ static char copyright[] = #define SRE_MODULE "sre" #endif +#define SRE_PY_MODULE "re" + /* defining this one enables tracing */ #undef VERBOSE @@ -2455,7 +2457,7 @@ pattern_subx(PatternObject* self, PyObject* template, PyObject* string, } else { /* not a literal; hand it over to the template compiler */ filter = call( - SRE_MODULE, "_subx", + SRE_PY_MODULE, "_subx", PyTuple_Pack(2, self, template) ); if (!filter) @@ -2872,7 +2874,7 @@ match_expand(MatchObject* self, PyObject* args) /* delegate to Python code */ return call( - SRE_MODULE, "_expand", + SRE_PY_MODULE, "_expand", PyTuple_Pack(3, self->pattern, self, template) ); }