[Zodb-checkins] SVN: zdaemon/trunk/zdoptions.py Massive style cleanup: Move to new raise exception style; for motivation, see:

Martijn Pieters mj at zopatista.com
Wed Aug 31 15:20:38 EDT 2005


Log message for revision 38211:
  Massive style cleanup: Move to new raise exception style; for motivation, see:
      
    http://permalink.gmane.org/gmane.comp.web.zope.zope3/13884
  
  

Changed:
  U   zdaemon/trunk/zdoptions.py

-=-
Modified: zdaemon/trunk/zdoptions.py
===================================================================
--- zdaemon/trunk/zdoptions.py	2005-08-31 19:12:24 UTC (rev 38210)
+++ zdaemon/trunk/zdoptions.py	2005-08-31 19:20:38 UTC (rev 38211)
@@ -136,41 +136,41 @@
 
         if flag is not None:
             if handler is not None:
-                raise ValueError, "use at most one of flag= and handler="
+                raise ValueError("use at most one of flag= and handler=")
             if not long and not short:
-                raise ValueError, "flag= requires a command line flag"
+                raise ValueError("flag= requires a command line flag")
             if short and short.endswith(":"):
-                raise ValueError, "flag= requires a command line flag"
+                raise ValueError("flag= requires a command line flag")
             if long and long.endswith("="):
-                raise ValueError, "flag= requires a command line flag"
+                raise ValueError("flag= requires a command line flag")
             handler = lambda arg, flag=flag: flag
 
         if short and long:
             if short.endswith(":") != long.endswith("="):
-                raise ValueError, "inconsistent short/long options: %r %r" % (
-                    short, long)
+                raise ValueError("inconsistent short/long options: %r %r" % (
+                    short, long))
 
         if short:
             if short[0] == "-":
-                raise ValueError, "short option should not start with '-'"
+                raise ValueError("short option should not start with '-'")
             key, rest = short[:1], short[1:]
             if rest not in ("", ":"):
-                raise ValueError, "short option should be 'x' or 'x:'"
+                raise ValueError("short option should be 'x' or 'x:'")
             key = "-" + key
             if self.options_map.has_key(key):
-                raise ValueError, "duplicate short option key '%s'" % key
+                raise ValueError("duplicate short option key '%s'" % key)
             self.options_map[key] = (name, handler)
             self.short_options.append(short)
 
         if long:
             if long[0] == "-":
-                raise ValueError, "long option should not start with '-'"
+                raise ValueError("long option should not start with '-'")
             key = long
             if key[-1] == "=":
                 key = key[:-1]
             key = "--" + key
             if self.options_map.has_key(key):
-                raise ValueError, "duplicate long option key '%s'" % key
+                raise ValueError("duplicate long option key '%s'" % key)
             self.options_map[key] = (name, handler)
             self.long_options.append(long)
 



More information about the Zodb-checkins mailing list