Skip to content

Commit 3850ee4

Browse files
committed
Linux: use of hasattr to prevent Exception on early exit
1 parent 848f42f commit 3850ee4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
# built documents.
6060
#
6161
# The short X.Y version.
62-
version = '2.0.19'
62+
version = '2.0.20'
6363
# The full version, including alpha/beta/rc tags.
6464
release = 'latest'
6565

mss/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from .exception import ScreenshotError
1414
from .factory import mss
1515

16-
__version__ = '2.0.19'
16+
__version__ = '2.0.20'
1717
__author__ = "Mickaël 'Tiger-222' Schoentgen"
1818
__copyright__ = '''
1919
Copyright (c) 2013-2016, Mickaël 'Tiger-222' Schoentgen

mss/linux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class MSS(MSSBase):
8585
def __del__(self):
8686
''' Disconnect from X server. '''
8787

88-
if self.display:
88+
if hasattr(self, 'display'):
8989
self.xlib.XCloseDisplay(self.display)
9090
self.display = None
9191

0 commit comments

Comments
 (0)