Skip to content

Commit a52b98d

Browse files
author
dessant
committed
Window.screenshot python 3 fix
1 parent 03c8d01 commit a52b98d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kivy/core/window/window_pygame.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ def screenshot(self, *largs, **kwargs):
260260
GL_UNSIGNED_BYTE)
261261
width, height = self.system_size
262262
data = glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE)
263-
# if PY2:
264-
# data = str(buffer(data))
265-
# else:
266-
# bytes(memoryview(data))
263+
if PY2:
264+
data = str(buffer(data))
265+
else:
266+
data = bytes(memoryview(data))
267267
surface = pygame.image.fromstring(data, (width, height), 'RGBA', True)
268268
pygame.image.save(surface, filename)
269269
Logger.debug('Window: Screenshot saved at <%s>' % filename)

0 commit comments

Comments
 (0)