summaryrefslogtreecommitdiff
path: root/Mac/Demo
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-04-25 22:05:36 +0000
committerJack Jansen <jack.jansen@cwi.nl>2001-04-25 22:05:36 +0000
commitf7538190f5efecd492f347702763971a5ca65ed5 (patch)
tree72141761596741a6983dff672ab85d1211813aaf /Mac/Demo
parent0037dcdcae9385b59c0e2290836542c9f17dedac (diff)
downloadcpython-f7538190f5efecd492f347702763971a5ca65ed5.tar.gz
Don't crash if InfoScrap doesn't exist (as is the case in Carbon).
Diffstat (limited to 'Mac/Demo')
-rw-r--r--Mac/Demo/textedit/ped.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Mac/Demo/textedit/ped.py b/Mac/Demo/textedit/ped.py
index 5c2d0f6013..9b222a3618 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