Skip to content

Commit 51a0222

Browse files
committed
Linux: better display management
1 parent 7e811cd commit 51a0222

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

mss/linux.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
c_uint, c_uint32, c_ulong, c_ushort, c_void_p, cast, cdll)
1010
from ctypes.util import find_library
1111
from os import environ
12-
from sys import maxsize, version
12+
from sys import maxsize
1313

1414
from .base import MSSBase
1515
from .exception import ScreenshotError
@@ -101,14 +101,11 @@ def __init__(self, display=None):
101101

102102
if not display:
103103
try:
104-
if version > '3':
105-
display = bytes(environ['DISPLAY'], 'utf-8')
106-
else:
107-
display = environ['DISPLAY']
104+
display = environ['DISPLAY']
108105
except KeyError:
109106
err = '$DISPLAY not set. Stopping to prevent segfault.'
110107
raise ScreenshotError(err)
111-
elif not isinstance(display, bytes):
108+
if not isinstance(display, bytes):
112109
display = bytes(display, 'utf-8')
113110

114111
x11 = find_library('X11')

0 commit comments

Comments
 (0)