]> granicus.if.org Git - python/commitdiff
Don't call MacOS.SchedParams() in MachO, it doesn't exist.
authorJack Jansen <jack.jansen@cwi.nl>
Sun, 9 Sep 2001 00:36:01 +0000 (00:36 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Sun, 9 Sep 2001 00:36:01 +0000 (00:36 +0000)
Mac/Lib/EasyDialogs.py

index 277d6d0201925da45c40b08c1a3c4b8684107cac..fa980cc11e5da9d06c5a7dc444f7906f74f96556 100644 (file)
@@ -418,7 +418,8 @@ def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfo
        d.SetDialogCancelItem(ARGV_ITEM_CANCEL)
        d.GetDialogWindow().ShowWindow()
        d.DrawDialog()
-       appsw = MacOS.SchedParams(1, 0)
+       if hasattr(MacOS, 'SchedParams'):
+               appsw = MacOS.SchedParams(1, 0)
        try:
                while 1:
                        stringstoadd = []
@@ -522,7 +523,8 @@ def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfo
                        newlist.append(item)
                return newlist
        finally:
-               apply(MacOS.SchedParams, appsw)
+               if hasattr(MacOS, 'SchedParams'):
+                       apply(MacOS.SchedParams, appsw)
                del d
        
 def test():
@@ -550,7 +552,8 @@ def test():
                        "So far, so good!", "Keep on truckin'" )
        bar = ProgressBar("Progress, progress...", 0, label="Ramping up...")
        try:
-               appsw = MacOS.SchedParams(1, 0)
+               if hasattr(MacOS, 'SchedParams'):
+                       appsw = MacOS.SchedParams(1, 0)
                for i in xrange(20):
                        bar.inc()
                        time.sleep(0.05)
@@ -564,7 +567,8 @@ def test():
                time.sleep(1.0)         # give'em a chance to see "Done."
        finally:
                del bar
-               apply(MacOS.SchedParams, appsw)
+               if hasattr(MacOS, 'SchedParams'):
+                       apply(MacOS.SchedParams, appsw)
 
 if __name__ == '__main__':
        try: