Author: andrewjlawrence Branch: winconsoleio Changeset: r97501:dfec1e76b2be Date: 2019-09-16 20:02 +0100 http://bitbucket.org/pypy/pypy/changeset/dfec1e76b2be/
Log: Merged discarded changes back in. diff --git a/pypy/module/_io/interp_win32consoleio.py b/pypy/module/_io/interp_win32consoleio.py --- a/pypy/module/_io/interp_win32consoleio.py +++ b/pypy/module/_io/interp_win32consoleio.py @@ -136,14 +136,14 @@ return '\0' m = '\0' - + # In CPython the _wcsicmp function is used to perform case insensitive comparison - decoded.lower() - if not rwin32.wcsicmp(decoded_wstr, CONIN): + dlower = decoded.lower() + if dlower == 'CONIN$'.lower(): m = 'r' - elif not rwin32.wcsicmp(decoded_wstr, CONOUT): + elif dlower == 'CONOUT$'.lower(): m = 'w' - elif not rwin32.wcsicmp(decoded_wstr, CON): + elif dlower == 'CON'.lower(): m = 'x' @@ -168,17 +168,15 @@ else: length = 0 - if length: - if length >= 4 and pname_buf[3] == u'\\' and \ - (pname_buf[2] == u'.' or pname_buf[2] == u'?') and \ - pname_buf[1] == u'\\' and pname_buf[0] == u'\\': - name = rffi.ptradd(pname_buf, 4) - - if not rwin32.wcsicmp(name, CONIN): + dlower = space.wcharp2unicode(pname_buf).lower() + if len(dlower) >=4: + if dlower[:4] == u'\\\\.\\' or dlower[:4] == u'\\\\?\\': + dlower = dlower[4:] + if dlower == u'CONIN$'.lower(): m = 'r' - elif not rwin32.wcsicmp(name, CONOUT): + elif dlower == u'CONOUT$'.lower(): m = 'w' - elif not rwin32.wcsicmp(name, CON): + elif dlower == u'CON'.lower(): m = 'x' lltype.free(pname_buf, flavor='raw') return m _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit