Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb30843

Browse files
committed
Don't call MacOS.SchedParams() in MachO, it doesn't exist.
1 parent a48d4ea commit eb30843

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Mac/Lib/EasyDialogs.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfo
418418
d.SetDialogCancelItem(ARGV_ITEM_CANCEL)
419419
d.GetDialogWindow().ShowWindow()
420420
d.DrawDialog()
421-
appsw = MacOS.SchedParams(1, 0)
421+
if hasattr(MacOS, 'SchedParams'):
422+
appsw = MacOS.SchedParams(1, 0)
422423
try:
423424
while 1:
424425
stringstoadd = []
@@ -522,7 +523,8 @@ def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfo
522523
newlist.append(item)
523524
return newlist
524525
finally:
525-
apply(MacOS.SchedParams, appsw)
526+
if hasattr(MacOS, 'SchedParams'):
527+
apply(MacOS.SchedParams, appsw)
526528
del d
527529

528530
def test():
@@ -550,7 +552,8 @@ def test():
550552
"So far, so good!", "Keep on truckin'" )
551553
bar = ProgressBar("Progress, progress...", 0, label="Ramping up...")
552554
try:
553-
appsw = MacOS.SchedParams(1, 0)
555+
if hasattr(MacOS, 'SchedParams'):
556+
appsw = MacOS.SchedParams(1, 0)
554557
for i in xrange(20):
555558
bar.inc()
556559
time.sleep(0.05)
@@ -564,7 +567,8 @@ def test():
564567
time.sleep(1.0) # give'em a chance to see "Done."
565568
finally:
566569
del bar
567-
apply(MacOS.SchedParams, appsw)
570+
if hasattr(MacOS, 'SchedParams'):
571+
apply(MacOS.SchedParams, appsw)
568572

569573
if __name__ == '__main__':
570574
try:

0 commit comments

Comments
 (0)