Skip to content

Commit 5bed4f4

Browse files
author
BoboTiG
committed
MSSLinux: fix object has no attribute 'display' into __del__
1 parent d89fa85 commit 5bed4f4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mss.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,11 @@ def __del__(self):
315315

316316
self.debug('__del__')
317317

318-
if self.display:
319-
self.xlib.XCloseDisplay(self.display)
318+
try:
319+
if self.display:
320+
self.xlib.XCloseDisplay(self.display)
321+
except AttributeError:
322+
pass
320323

321324
def __init__(self):
322325
''' GNU/Linux initialisations '''

0 commit comments

Comments
 (0)