equal
deleted
inserted
replaced
84 # fast path mainly for py2 |
84 # fast path mainly for py2 |
85 return xs |
85 return xs |
86 return _rapply(f, xs) |
86 return _rapply(f, xs) |
87 |
87 |
88 |
88 |
89 if os.name == r'nt' and sys.version_info >= (3, 6): |
89 if os.name == r'nt': |
90 # MBCS (or ANSI) filesystem encoding must be used as before. |
90 # MBCS (or ANSI) filesystem encoding must be used as before. |
91 # Otherwise non-ASCII filenames in existing repositories would be |
91 # Otherwise non-ASCII filenames in existing repositories would be |
92 # corrupted. |
92 # corrupted. |
93 # This must be set once prior to any fsencode/fsdecode calls. |
93 # This must be set once prior to any fsencode/fsdecode calls. |
94 sys._enablelegacywindowsfsencoding() # pytype: disable=module-attr |
94 sys._enablelegacywindowsfsencoding() # pytype: disable=module-attr |
413 if isinstance(s, (bytes, bytearray)): |
413 if isinstance(s, (bytes, bytearray)): |
414 s = s.decode(_detect_encoding(s), 'surrogatepass') |
414 s = s.decode(_detect_encoding(s), 'surrogatepass') |
415 |
415 |
416 return json.loads(s, *args, **kwargs) |
416 return json.loads(s, *args, **kwargs) |
417 |
417 |
418 |
|
419 else: |
418 else: |
420 json_loads = json.loads |
419 json_loads = json.loads |
421 |
420 |
422 isjython = sysplatform.startswith(b'java') |
421 isjython = sysplatform.startswith(b'java') |
423 |
422 |