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: apache/airflow#30405 (comment)

Fixes: #30465
GitOrigin-RevId: 56ff116ab3a005a07d62adbb7a0bdc0443cf2b85
  • Loading branch information
potiuk authored and Cloud Composer Team committed Jun 12, 2023
1 parent 138eda5 commit 5161481
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 5161481

Please sign in to comment.