[pypy-commit] pypy py3.6: remove (duplicate) equivalent of 0395c16d6bbe

mattip pypy.commits at gmail.com
Mon Feb 3 16:50:02 EST 2020


Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.6
Changeset: r98656:0b996481653b
Date: 2020-02-03 23:40 +0200
http://bitbucket.org/pypy/pypy/changeset/0b996481653b/

Log:	remove (duplicate) equivalent of 0395c16d6bbe

diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py
--- a/pypy/module/_io/interp_textio.py
+++ b/pypy/module/_io/interp_textio.py
@@ -237,15 +237,6 @@
     if encoding is not None:
         return space.newtext(encoding)
 
-    # Try to shortcut the app-level call if locale.CODESET works
-    if _WINDOWS:
-        return space.newtext(rlocale.getdefaultlocale()[1])
-    else:
-        if rlocale.HAVE_LANGINFO:
-            codeset = rlocale.nl_langinfo(rlocale.CODESET)
-            if codeset:
-                return space.newtext(codeset)
-
     # Try os.device_encoding(fileno) which is interp_posix.device_encoding
     try:
         w_fileno = space.call_method(w_buffer, 'fileno')
@@ -259,16 +250,6 @@
         if space.isinstance_w(w_encoding, space.w_unicode):
             return w_encoding
 
-    # Try to shortcut the app-level call if locale.CODESET works
-    if _WINDOWS:
-        return space.newtext(rlocale.getdefaultlocale()[1])
-    else:
-        if rlocale.HAVE_LANGINFO:
-            codeset = rlocale.nl_langinfo(rlocale.CODESET)
-            if codeset:
-                return space.newtext(codeset)
-
-    
     # On legacy systems or darwin, try app-level 
     # _bootlocale.getprefferedencoding(False)
     try:


More information about the pypy-commit mailing list