Skip to content

Commit 001f0d4

Browse files
author
Craig Cornelius
authored
Fix python regex (#513)
* DateTime Format: remove testing before ICU77 / CLDR 47 * Adding back ICU 76 datetime tests * Updating regex compile statements
1 parent 7b304b6 commit 001f0d4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

testgen/generators/collation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def set_patterns(self):
5959
]
6060

6161
# For detecting and converting \x, \u, and \U coded values
62-
self.xcoding = re.compile("\\\\x([0-9A-Fa-f]{2})")
63-
self.escaped_ucoding = re.compile("\\\\u([0-9A-Fa-f]{4})")
64-
self.escaped_bigU_coding = re.compile("\\\\U([0-9A-Fa-f]{8})")
62+
self.xcoding = re.compile(r"\\x([0-9A-Fa-f]{2})")
63+
self.escaped_ucoding = re.compile(r"\\u([0-9A-Fa-f]{4})")
64+
self.escaped_bigU_coding = re.compile(r"\\U([0-9A-Fa-f]{8})")
6565

6666
def process_test_data(self):
6767
# Get each kind of collation tests and create a unified data set

testgen/generators/number_fmt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
from generators.base import DataGenerator
77

8-
reblankline = re.compile("^\s*$")
8+
reblankline = re.compile(r"^\s*$")
99

1010
# Global constants
1111
# Values to be formatted in number format tests
@@ -166,7 +166,7 @@ def parseNumberFmtTestData(self, rawtestdata):
166166
# Source data: https://github.com/unicode-org/icu/blob/main/icu4c/source/test/testdata/dcfmtest.txt
167167
def generateDcmlFmtTestDataObjects(self, rawtestdata, count=0):
168168
original_count = count
169-
recommentline = re.compile("^\s*#")
169+
recommentline = re.compile(r"^\s*#")
170170
test_list = rawtestdata.splitlines()
171171

172172
all_tests_list = []

testgen/generators/plurals.py

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

99
from generators.base import DataGenerator
1010

11-
reblankline = re.compile("^\s*$")
11+
reblankline = re.compile(r"^\s*$")
1212

1313
class PluralGenerator(DataGenerator):
1414
def plurals_descriptor(self):

0 commit comments

Comments
 (0)