Skip to content

Commit e9cf0fa

Browse files
authored
Put simpler regex first
1 parent 187542a commit e9cf0fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/_pyrepl/console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def runsource(self, source, filename="<input>", symbol="single"):
199199
except SyntaxError as e:
200200
# If it looks like pip install was entered (a common beginner
201201
# mistake), provide a hint to use the system command prompt.
202-
if re.match(r"^\s*(py(thon3?)? -m pip|pip3?) install.*", source):
202+
if re.match(r"^\s*(pip3?|py(thon3?)? -m pip) install.*", source):
203203
e.add_note(
204204
"The Python package manager (pip) can only be used"
205205
" outside of the Python REPL.\n"

0 commit comments

Comments
 (0)