From: Jack Jansen Date: Wed, 25 Apr 2001 22:05:36 +0000 (+0000) Subject: Don't crash if InfoScrap doesn't exist (as is the case in Carbon). X-Git-Tag: v2.2a3~1960 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee677913df35c8c4c5ea91e3c85a3061f01bb26d;p=thirdparty%2FPython%2Fcpython.git Don't crash if InfoScrap doesn't exist (as is the case in Carbon). --- diff --git a/Mac/Demo/textedit/ped.py b/Mac/Demo/textedit/ped.py index 5c2d0f6013d0..9b222a361834 100644 --- a/Mac/Demo/textedit/ped.py +++ b/Mac/Demo/textedit/ped.py @@ -155,7 +155,6 @@ class TEWindow(ScrolledWindow): self.parent.updatemenubar() def menu_paste(self): - print 'SCRAP', Scrap.InfoScrap(), `Scrap.InfoScrap()[1].data` TE.TEFromScrap() self.ted.TESelView() self.ted.TEPaste() @@ -224,7 +223,11 @@ class Ped(Application): m.enable(on) self.focusgroup_on = on changed = 1 - on = (Scrap.InfoScrap()[0] <> 0) + if hasattr(Scrap, 'InfoScrap'): + on = (Scrap.InfoScrap()[0] <> 0) + else: + # Not there yet on Carbon, simply always enable + on = 1 if on <> self.pastegroup_on: self.pasteitem.enable(on) self.pastegroup_on = on