[Zope-Checkins] CVS: Zope/lib/python/zdaemon - zdoptions.py:1.22.16.3

Andreas Jung andreas at andreas-jung.com
Thu Jun 3 02:50:22 EDT 2004


Update of /cvs-repository/Zope/lib/python/zdaemon
In directory cvs.zope.org:/tmp/cvs-serv3802/lib/python/zdaemon

Modified Files:
      Tag: Zope-2_7-branch
	zdoptions.py 
Log Message:
zdoptions raised an exception because sys.argv is not available
if one tries to embed Zope within C/C++.


=== Zope/lib/python/zdaemon/zdoptions.py 1.22.16.2 => 1.22.16.3 ===
--- Zope/lib/python/zdaemon/zdoptions.py:1.22.16.2	Sun Dec 21 18:28:21 2003
+++ Zope/lib/python/zdaemon/zdoptions.py	Thu Jun  3 02:50:21 2004
@@ -201,9 +201,17 @@
 
          # Provide dynamic default method arguments
         if args is None:
-            args = sys.argv[1:]
+            try:
+                args = sys.argv[1:]
+            except AttributeError:
+                args = ()
+
         if progname is None:
-            progname = sys.argv[0]
+            try:
+                progname = sys.argv[0]
+            except AttributeError:
+                progname = 'zope'
+
         if doc is None:
             import __main__
             doc = __main__.__doc__




More information about the Zope-Checkins mailing list