[Zope-Checkins] SVN: Zope/trunk/ zdoptions raised an exception because sys.argv is not available

Andreas Jung andreas at andreas-jung.com
Thu Jun 3 02:47:40 EDT 2004


Log message for revision 25220:
zdoptions raised an exception because sys.argv is not available
if one tries to embed Zope within C/C++.




-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt	2004-06-03 05:10:47 UTC (rev 25219)
+++ Zope/trunk/doc/CHANGES.txt	2004-06-03 06:47:40 UTC (rev 25220)
@@ -122,6 +122,9 @@
 
     Bugs fixed
 
+     - Zope can now be embedded in C/C++ without exceptions being raised
+       in zdoptions.
+
      - Collector #1213: Fixed wrong labels of cache parameters 
 
      - Collector #1265: Fixed handling of orphans in ZTUtil.Batch

Modified: Zope/trunk/lib/python/zdaemon/zdoptions.py
===================================================================
--- Zope/trunk/lib/python/zdaemon/zdoptions.py	2004-06-03 05:10:47 UTC (rev 25219)
+++ Zope/trunk/lib/python/zdaemon/zdoptions.py	2004-06-03 06:47:40 UTC (rev 25220)
@@ -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