Ronald Oussoren  committed e2b95f0

Add default argument to runEventLoop

  • Participants
  • Parent commits 6bf6f7a

Comments (0)

Files changed (1)

File pyobjc/Lib/PyObjCTools/

 from AppKit import NSApplicationMain, NSApp, NSRunAlertPanel
 import traceback
+import sys
 def unexpectedErrorAlert():
     exceptionInfo = traceback.format_exception_only(
             "Continue", "Quit", None)
-def runEventLoop(argv, unexpectedErrorAlert = unexpectedErrorAlert):
+def runEventLoop(argv = None, unexpectedErrorAlert = unexpectedErrorAlert):
     Run the event loop, ask the user if we should continue when 
     catching exceptions. Use this function instead of NSApplicationMain
+    if argv is None:
+        argv = sys.argv
     mainFunc = NSApplicationMain
     args = (argv,)
     while 1: