[Checkins] SVN: zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/config.py Remove uselesss try: except: block.

Tres Seaver cvs-admin at zope.org
Wed May 9 05:50:51 UTC 2012


Log message for revision 125750:
  Remove uselesss try: except: block.
  
  By inspection, the code wrapped cannot raise the given error.

Changed:
  U   zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/config.py

-=-
Modified: zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/config.py
===================================================================
--- zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/config.py	2012-05-09 05:50:43 UTC (rev 125749)
+++ zope.configuration/branches/tseaver-test_cleanup/src/zope/configuration/config.py	2012-05-09 05:50:47 UTC (rev 125750)
@@ -129,11 +129,8 @@
             pnames = self.package.__name__.split(".")
             pnames.append('')
             while names and not names[0]:
+                names.pop(0)
                 try:
-                    names.pop(0)
-                except IndexError:
-                    raise ConfigurationError("Invalid global name", name)
-                try:
                     pnames.pop()
                 except IndexError:
                     raise ConfigurationError("Invalid global name", name)



More information about the checkins mailing list