已合并
fix SyntaxWarning: invalid escape sequence '$' and '\w' #1497
hehongan创建于 4月9日
fix SyntaxWarning: invalid escape sequence '$' and '\w' #1497
已合并
共 3 个文件变更+3-3
| @@ -169,7 +169,7 @@ def get_kernel_source(src_file, dir_snake, dir_ex): | |||
| 169 | 169 | ||
| 170 | ''' | 170 | ''' |
| 171 | 171 | ||
| 172 | -IMPL_API = ''' | 172 | +IMPL_API = r''' |
| 173 | 173 | ||
| 174 | 174 | ||
| 175 | def {}({}, kernel_name="{}"{}): | 175 | def {}({}, kernel_name="{}"{}): |
| @@ -176,7 +176,7 @@ def skip_mc2_context_size(opinfo: OpInfo): | |||
| 176 | def match_options(options, compile_options): | 176 | def match_options(options, compile_options): |
| 177 | result = [] | 177 | result = [] |
| 178 | for option in options: | 178 | for option in options: |
| 179 | - match = re.search(f'{option}=(\w+)', ' '.join(compile_options)) | 179 | + match = re.search(rf'{option}=(\w+)', ' '.join(compile_options)) |
| 180 | if match: | 180 | if match: |
| 181 | result.append(match.group(1)) | 181 | result.append(match.group(1)) |
| 182 | else: | 182 | else: |
| @@ -176,7 +176,7 @@ def skip_mc2_context_size(opinfo: OpInfo): | |||
| 176 | def match_options(options, compile_options): | 176 | def match_options(options, compile_options): |
| 177 | result = [] | 177 | result = [] |
| 178 | for option in options: | 178 | for option in options: |
| 179 | - match = re.search(f'{option}=(\w+)', ' '.join(compile_options)) | 179 | + match = re.search(rf'{option}=(\w+)', ' '.join(compile_options)) |
| 180 | if match: | 180 | if match: |
| 181 | result.append(match.group(1)) | 181 | result.append(match.group(1)) |
| 182 | else: | 182 | else: |