]> granicus.if.org Git - python/commitdiff
Close #3067: locale.setlocale() accepts a Unicode locale.
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 20 Jun 2011 14:14:48 +0000 (16:14 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 20 Jun 2011 14:14:48 +0000 (16:14 +0200)
Lib/locale.py
Misc/NEWS

index bb4aa37b2906bdc9e27e67702a36eac476f3a9de..f204b564b93c666f71ef8db727db802b4305692a 100644 (file)
@@ -525,7 +525,7 @@ def setlocale(category, locale=None):
         category may be given as one of the LC_* values.
 
     """
-    if locale and type(locale) is not type(""):
+    if locale and not isinstance(locale, basestring):
         # convert to string
         locale = normalize(_build_localename(locale))
     return _setlocale(category, locale)
index 2e33e7f5b801d920203eda6b185e59349ce3d05e..d45582894ca7c35ef12a00342fe63142e7346ae6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #3067: locale.setlocale() accepts a Unicode locale.
+
 - Issue #11700: mailbox proxy object close methods can now be called multiple
   times without error, and _ProxyFile now closes the wrapped file.