Skip to content

Commit 329e32a

Browse files
Fix warning on language detector
language_detector.py:104: FutureWarning: Possible nested set at position 9 if re.search(pattern.pattern, code):
1 parent cf19c91 commit 329e32a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

yepcode_run/utils/language_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class LanguageDetector:
3838
Pattern(r"else:", 2), # else keyword
3939
Pattern(r"for (\w+|\(?\w+,( )*\w+\)?) in (.+):", 2), # for loop
4040
Pattern(r"\w+( )*=( )*\w+(?!;)(\n|$)", 1), # Variable assignment
41-
Pattern(r"import ([[^\.]\w])+", 1), # import statement
41+
Pattern(r"import [^\.\s]+", 1), # import statement
4242
Pattern(r"print((( )*\(.+\))|( )+.+)", 1), # print statement
4343
]
4444

0 commit comments

Comments
 (0)