Skip to content

Commit 91913c5

Browse files
authored
[Infra] Use raw string for TAG_VERSION_REGEX (#68063)
1 parent b171068 commit 91913c5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

python/env_dict.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ env_dict={
33
'PADDLE_SOURCE_DIR':'@PADDLE_SOURCE_DIR@',
44
'PADDLE_VERSION':'@PADDLE_VERSION@',
55
'PADDLE_BINARY_DIR':'@PADDLE_BINARY_DIR@',
6-
'TAG_VERSION_REGEX':'@TAG_VERSION_REGEX@',
6+
'TAG_VERSION_REGEX':r'@TAG_VERSION_REGEX@',
77
'WITH_GPU':'@WITH_GPU@',
88
'WITH_NCCL':'@WITH_NCCL@',
99
'CUDNN_MAJOR_VERSION':'@CUDNN_MAJOR_VERSION@',

python/setup.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _get_version_detail(idx):
4343
assert idx < 3, "vesion info consists of %(major)d.%(minor)d.%(patch)d, \
4444
so detail index must less than 3"
4545

46-
if re.match('@TAG_VERSION_REGEX@', '@PADDLE_VERSION@'):
46+
if re.match(r'@TAG_VERSION_REGEX@', '@PADDLE_VERSION@'):
4747
version_details = '@PADDLE_VERSION@'.split('.')
4848

4949
if len(version_details) >= 3:

python/setup_cinn.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _get_version_detail(idx):
2727
assert idx < 3, "vesion info consists of %(major)d.%(minor)d.%(patch)d, \
2828
so detail index must less than 3"
2929

30-
if re.match('${TAG_VERSION_REGEX}', '${PADDLE_VERSION}'):
30+
if re.match(r'${TAG_VERSION_REGEX}', '${PADDLE_VERSION}'):
3131
version_details = '${PADDLE_VERSION}'.split('.')
3232

3333
if len(version_details) >= 3:

0 commit comments

Comments
 (0)