Skip to content

Commit

Permalink
SQ -> ...: Fix pyscreeze locally
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfstr committed Dec 25, 2023
1 parent e1b6333 commit 3ebff3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/crystal/tests/util/screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def screenshot_if_raises() -> Iterator[None]:
except ImportError: # probably PIL missing
print('*** Unable to save screenshot because pyscreeze is not available.', file=sys.stderr)
else:
# HACK: Patch pyscreeze's imported PIL.__version__ so it has
# the type that pyscreeze._screenshot_osx() expects.
pyscreeze.PIL__version__ = [
int(c) for c in pyscreeze.PIL__version__.split('.')]
# HACK: Force pyscreeze to use 'screencapture' tool on macOS
# in _screenshot_osx() rather than ImageGrab.grab(),
# which doesn't seem to work on macOS 12+
pyscreeze.PIL__version__ = [1, 0, 0] # pretend PIL is old version

os.makedirs(screenshots_dirpath, exist_ok=True)

Expand Down

0 comments on commit 3ebff3b

Please sign in to comment.