Skip to content

Commit 0dfdbe6

Browse files
author
BoboTiG
committed
Python 2.6 compatible again
1 parent 4edcaaf commit 0dfdbe6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

mss/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,5 @@ def to_png(self, data, width, height, output):
133133
fileh.write(b''.join(iend))
134134
return
135135

136-
err = 'Error writing data to "{}".'.format(output)
136+
err = 'Error writing data to "{0}".'.format(output)
137137
raise ScreenshotError(err)

mss/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def mss(*args, **kwargs):
2828
elif operating_system == 'windows':
2929
from .windows import MSS
3030
else:
31-
err = 'System "{}" not implemented.'.format(operating_system)
31+
err = 'System "{0}" not implemented.'.format(operating_system)
3232
raise ScreenshotError(err)
3333

3434
return MSS(*args, **kwargs)

mss/linux.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def __init__(self):
104104
self.xrandr = cdll.LoadLibrary(xrandr)
105105

106106
# libmss = find_library('mss')
107-
libmss = '{}/linux/{}/libmss.so'.format(
107+
libmss = '{0}/linux/{1}/libmss.so'.format(
108108
dirname(realpath(abspath(__file__))), arch())
109109
if isfile(libmss):
110110
self.mss = cdll.LoadLibrary(libmss)
@@ -119,7 +119,7 @@ def __init__(self):
119119
try:
120120
assert self.display.contents
121121
except ValueError:
122-
raise ScreenshotError('Cannot open display "{}".'.format(disp))
122+
raise ScreenshotError('Cannot open display "{0}".'.format(disp))
123123
self.screen = self.xlib.XDefaultScreen(self.display)
124124
self.root = self.xlib.XDefaultRootWindow(self.display, self.screen)
125125

@@ -256,7 +256,7 @@ def get_pixels(self, monitor):
256256
ret = self.mss.GetXImagePixels(ximage, self.image)
257257
if not ret:
258258
self.xlib.XDestroyImage(ximage)
259-
err = 'libmss.GetXImagePixels() failed (retcode={}).'
259+
err = 'libmss.GetXImagePixels() failed (retcode={0}).'
260260
raise ScreenshotError(err.format(ret))
261261
self.xlib.XDestroyImage(ximage)
262262
return self.image

0 commit comments

Comments
 (0)