Source

pygame / lib / mac_scrap.py

Diff from to

lib/mac_scrap.py

 import pygame.image
 from pygame.locals import SCRAP_TEXT, SCRAP_BMP, SCRAP_SELECTION, SCRAP_CLIPBOARD
 from cStringIO import StringIO
+from pygame.compat import unicode_
 
-ScrapPboardType = u'org.pygame.scrap'
+ScrapPboardType = unicode_('org.pygame.scrap')
 
 
 err = "Only text has been implemented for scrap on mac. See lib/mac_scrap.py to debug."
     board = NSPasteboard.generalPasteboard()
     
     if 0:
-        print board.types
-        print dir(board.types)
-        print dir(board)
-        print board.__doc__
+        print (board.types)
+        print (dir(board.types))
+        print (dir(board))
+        print (board.__doc__)
 
     if scrap_type == SCRAP_TEXT:
         return board.stringForType_(NSStringPboardType)
         else:
             text_thing = unicode(thing, 'utf-8')
         board.setString_forType_(text_thing, NSStringPboardType)
-        board.setString_forType_(u'', ScrapPboardType)
+        board.setString_forType_(unicode_(''), ScrapPboardType)
     elif 1:
         raise NotImplementedError(err)
 
         fh.close()
         board.declareTypes_owner_([NSTIFFPboardType, ScrapPboardType], None)
         board.setData_forType_(tiff, NSTIFFPboardType)
-        board.setString_forType_(u'', ScrapPboardType)
+        board.setString_forType_(unicode_(''), ScrapPboardType)
     elif scrap_type == SCRAP_BMP:
         
         other_type = scrap_type