Skip to content

Commit b9534fe

Browse files
author
BoboTiG
committed
MSSLinux: little workaround for python3
1 parent cb64647 commit b9534fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mss.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ def init(self):
308308
display = None
309309
self.display = None
310310
try:
311-
display = environ[b'DISPLAY']
311+
try: # python3
312+
display = bytes(environ['DISPLAY'], 'utf-8')
313+
except TypeError: # python2
314+
display = environ['DISPLAY']
312315
except KeyError:
313316
err = 'MSSLinux: $DISPLAY not set. Stopping to prevent segfault.'
314317
raise ValueError(err)

0 commit comments

Comments
 (0)