Skip to content

fix: add missing sys import in watch.py#392

Open
shaun0927 wants to merge 1 commit intosafishamsi:v4from
shaun0927:fix/watch-sys-import-v3
Open

fix: add missing sys import in watch.py#392
shaun0927 wants to merge 1 commit intosafishamsi:v4from
shaun0927:fix/watch-sys-import-v3

Conversation

@shaun0927
Copy link
Copy Markdown

Fixes #386.

watch() references sys.platform at line 150 to select PollingObserver on macOS, but sys was never imported. This causes NameError on all platforms when running graphify watch.

Introduced in v0.4.15 by #373 (macOS PollingObserver change).

Change

One line: import sys added to module imports in graphify/watch.py.

Testing

# Before fix:
python -c "from graphify.watch import watch; from pathlib import Path; watch(Path('.'))"
# NameError: name 'sys' is not defined

# After fix:
python -c "from graphify.watch import watch; from pathlib import Path; watch(Path('.'))"
# [graphify watch] Watching /path - press Ctrl+C to stop

Full test suite: 433 passed, 0 failures.

watch() references sys.platform at line 150 to select PollingObserver
on macOS, but sys was never imported. This causes NameError on all
platforms when running graphify watch.

Introduced in v0.4.15 by the macOS PollingObserver change (safishamsi#373).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

graphify watch crashes with NameError on all platforms (v0.4.15 regression)

1 participant