Skip to content

Commit 49135e6

Browse files
committed
Guard Windows keypress fallback against redirected stdin
1 parent 034bd3a commit 49135e6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mcpm/migration/v1_migrator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ def _wait_for_keypress(self, message: str):
6060
else:
6161
try:
6262
import msvcrt
63+
try:
64+
msvcrt.getch()
65+
except OSError:
66+
input()
6367
except ImportError:
6468
input()
65-
else:
66-
msvcrt.getch()
6769

6870
console.print() # Add newline after keypress
6971

0 commit comments

Comments
 (0)