]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
In `Locale.parse()`, only parse the argument if it's a string, otherwise just return...
authorChristopher Lenz <cmlenz@gmail.com>
Wed, 5 Sep 2007 16:40:17 +0000 (16:40 +0000)
committerChristopher Lenz <cmlenz@gmail.com>
Wed, 5 Sep 2007 16:40:17 +0000 (16:40 +0000)
babel/core.py

index 4e8e032faec8652f05a5737da626061696d93bf4..3b237cff4bd8a6baf374023779d98b523d29d41d 100644 (file)
@@ -206,9 +206,9 @@ class Locale(object):
                                      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):