[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/tool.py Correct handling of invalid context ids

Wichert Akkerman wichert at wiggy.net
Thu Feb 21 06:19:49 EST 2008


Log message for revision 84102:
  Correct handling of invalid context ids

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/tool.py

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/tool.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/tool.py	2008-02-21 10:16:34 UTC (rev 84101)
+++ Products.GenericSetup/trunk/Products/GenericSetup/tool.py	2008-02-21 11:19:49 UTC (rev 84102)
@@ -1006,15 +1006,16 @@
                 if should_purge is None:
                     should_purge = True
                 return SnapshotImportContext(self, context_id, should_purge, encoding)
-        elif archive is not None:
+
+        if archive is not None:
             return TarballImportContext(tool=self,
                                        archive_bits=archive,
                                        encoding='UTF8',
                                        should_purge=should_purge,
                                       )
-        else:
-            raise KeyError, 'Unknown context "%s"' % context_id
 
+        raise KeyError, 'Unknown context "%s"' % context_id
+
     security.declarePrivate('_updateImportStepsRegistry')
     def _updateImportStepsRegistry(self, context, encoding):
 



More information about the Checkins mailing list