mirror of https://github.com/kivy/kivy.git
osx/clipboard: ensure that the string doesn't ends with null byte, otherwise it will crash.
This commit is contained in:
parent
e388f71517
commit
a28485e6a8
|
@ -7,7 +7,7 @@ __all__ = ('ClipboardPygame', )
|
|||
from kivy.utils import platform
|
||||
from . import ClipboardBase
|
||||
|
||||
if platform() not in ('win', 'linux'):
|
||||
if platform() not in ('win', 'linux', 'macosx'):
|
||||
raise SystemError('unsupported platform for pygame clipboard')
|
||||
|
||||
try:
|
||||
|
@ -33,6 +33,8 @@ class ClipboardPygame(ClipboardBase):
|
|||
|
||||
def put(self, data, mimetype='text/plain'):
|
||||
self.init()
|
||||
if platform() == 'macosx' and data.endswith('\x00'):
|
||||
data = data[:-1]
|
||||
pygame.scrap.put(mimetype, data)
|
||||
|
||||
def get_types(self):
|
||||
|
|
Loading…
Reference in New Issue