[Python-checkins] distutils2: Cleanup: move code out of a try block

eric.araujo python-checkins at python.org
Mon Sep 19 15:12:39 CEST 2011


http://hg.python.org/distutils2/rev/1ab1204d1ad1
changeset: 1163:1ab1204d1ad1
user: Éric Araujo <merwok at netwok.org>
date: Mon Sep 19 03:22:30 2011 +0200
summary:
 Cleanup: move code out of a try block
files:
 distutils2/command/__init__.py | 8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/distutils2/command/__init__.py b/distutils2/command/__init__.py
--- a/distutils2/command/__init__.py
+++ b/distutils2/command/__init__.py
@@ -51,9 +51,9 @@
 """Return the registered command"""
 try:
 cls = _COMMANDS[name]
- if isinstance(cls, basestring):
- cls = resolve_name(cls)
- _COMMANDS[name] = cls
- return cls
 except KeyError:
 raise PackagingModuleError("Invalid command %s" % name)
+ if isinstance(cls, str):
+ cls = resolve_name(cls)
+ _COMMANDS[name] = cls
+ return cls
-- 
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /