Skip to content

Commit c9ab4be

Browse files
author
BoboTiG
committed
Fix for Python 2.6: zero length field name in format
1 parent 25f0a32 commit c9ab4be

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mss.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class BITMAPINFOHEADER(Structure):
103103
class BITMAPINFO(Structure):
104104
_fields_ = [('bmiHeader', BITMAPINFOHEADER), ('bmiColors', DWORD * 3)]
105105
else:
106-
raise ScreenshotError('MSS: system "{}" not implemented.'.format(system()))
106+
raise ScreenshotError('MSS: system "{0}" not implemented.'.format(system()))
107107

108108

109109
# ----------------------------------------------------------------------
@@ -119,9 +119,9 @@ def debug(self, method='', scalar=None, value=None):
119119

120120
if self.DEBUG:
121121
if scalar is None:
122-
print(':: {}()'.format(method))
122+
print(':: {0}()'.format(method))
123123
else:
124-
print('{}() {} {} {}'.format(method, scalar,
124+
print('{0}() {1} {2} {3}'.format(method, scalar,
125125
type(value).__name__, value))
126126

127127
def enum_display_monitors(self):
@@ -234,7 +234,7 @@ def save_img(self, data, width, height, output):
234234
fileh.write(
235235
magic + b''.join(ihdr) + b''.join(idat) + b''.join(iend))
236236
return
237-
raise ScreenshotError('MSS: error writing data to "{}".'.format(output))
237+
raise ScreenshotError('MSS: error writing data to "{0}".'.format(output))
238238

239239

240240
class MSSMac(MSS):
@@ -300,7 +300,7 @@ def save_img(self, data, width, height, output):
300300
CGImageDestinationAddImage(dest, data, None)
301301
if CGImageDestinationFinalize(dest):
302302
return
303-
raise ScreenshotError('MSS: error writing to file "{}".'.format(output))
303+
raise ScreenshotError('MSS: error writing to file "{0}".'.format(output))
304304

305305

306306
class MSSLinux(MSS):
@@ -647,7 +647,7 @@ def on_exists(fname):
647647
from os.path import isfile
648648
if isfile(fname):
649649
newfile = fname + '.old'
650-
print('{} -> {}'.format(fname, newfile))
650+
print('{0} -> {1}'.format(fname, newfile))
651651
rename(fname, newfile)
652652
return True
653653

0 commit comments

Comments
 (0)