changeset 284:6aec37b65b30 stable

Ported [309] to 0.9.x branch.
author cmlenz
date Wed, 05 Sep 2007 16:43:08 +0000
parents 861e651fe44e
children 976bdff479ac
files 0.9.x/babel/core.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/0.9.x/babel/core.py
+++ b/0.9.x/babel/core.py
@@ -206,9 +206,9 @@
                                      requested locale
         :see: `parse_locale`
         """
-        if type(identifier) is cls:
-            return identifier
-        return cls(*parse_locale(identifier, sep=sep))
+        if isinstance(identifier, basestring):
+            return cls(*parse_locale(identifier, sep=sep))
+        return identifier
     parse = classmethod(parse)
 
     def __eq__(self, other):
Copyright (C) 2012-2017 Edgewall Software