changeset 282:ccc9614b21d3 stable-0.9.x

Ported [309] to 0.9.x branch.
author cmlenz
date Wed, 05 Sep 2007 16:43:08 +0000
parents 1f705a64f58f
children 0ee9dc258c2d
files babel/core.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/babel/core.py
+++ b/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