Skip to content

Commit

Permalink
Fix Breeze failing with error on Windows (#30464)
Browse files Browse the repository at this point in the history
When breeze is run on Windows it fails with FileNotFoundException
when running uname during emulation check. This is now fixed alongside
fixing TimeoutError misplacement - after moving it to local import,
an exception triggered before importing it causes UnboundLocaalError.

Related: #30405 (comment)

Fixes: #30465
  • Loading branch information
potiuk authored Apr 4, 2023
1 parent 112d4d6 commit 56ff116
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions dev/breeze/src/airflow_breeze/commands/main_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,21 @@ def check_for_python_emulation():
)
from inputimeout import TimeoutOccurred, inputimeout

user_status = inputimeout(
prompt="Are you REALLY sure you want to continue? (answer with y otherwise we exit in 20s)\n",
timeout=20,
)
if user_status.upper() not in ["Y", "YES"]:
try:
user_status = inputimeout(
prompt="Are you REALLY sure you want to continue? "
"(answer with y otherwise we exit in 20s)\n",
timeout=20,
)
if user_status.upper() not in ["Y", "YES"]:
sys.exit(1)
except TimeoutOccurred:
from airflow_breeze.utils.console import get_console

get_console().print("\nNo answer, exiting...")
sys.exit(1)
except TimeoutOccurred:
get_console().print("\nNo answer, exiting...")
sys.exit(1)
except FileNotFoundError:
pass
except subprocess.CalledProcessError:
pass
except PermissionError:
Expand Down

0 comments on commit 56ff116

Please sign in to comment.