Skip to content

Commit b62832b

Browse files
committed
linux: tweaks
1 parent 69655e6 commit b62832b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/mss/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from .exception import ScreenShotError
1212
from .factory import mss
1313

14-
__version__ = "8.0.3"
14+
__version__ = "8.0.4"
1515
__author__ = "Mickaël 'Tiger-222' Schoentgen"
1616
__copyright__ = """
1717
Copyright (c) 2013-2023, Mickaël 'Tiger-222' Schoentgen

src/mss/linux.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def _error_handler(display: Display, event: XErrorEvent) -> int:
223223

224224

225225
def _validate(retval: int, func: Any, args: Tuple[Any, Any], /) -> Tuple[Any, Any]:
226-
"""Validate the returned value of a Xlib or XRANDR function."""
226+
"""Validate the returned value of a C function call."""
227227

228228
thread = current_thread()
229229
if retval != 0 and thread not in _ERROR:
@@ -331,7 +331,7 @@ def __init__(self, /, **kwargs: Any) -> None:
331331

332332
def close(self) -> None:
333333
# Remove our error handler
334-
if self._handles.original_error_handler is not None:
334+
if self._handles.original_error_handler:
335335
# It's required when exiting MSS to prevent letting `_error_handler()` as default handler.
336336
# Doing so would crash when using Tk/Tkinter, see issue #220.
337337
# Interesting technical stuff can be found here:
@@ -341,7 +341,7 @@ def close(self) -> None:
341341
self._handles.original_error_handler = None
342342

343343
# Clean-up
344-
if self._handles.display is not None:
344+
if self._handles.display:
345345
self.xlib.XCloseDisplay(self._handles.display)
346346
self._handles.display = None
347347
self._handles.drawable = None

tests-requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
pytest
2-
pytest-cov
31
numpy
42
pillow
3+
pytest
4+
pytest-cov
5+
pyvirtualdisplay; sys_platform == "linux"
56
sphinx
6-
PyVirtualDisplay; sys_platform == "linux"

0 commit comments

Comments
 (0)