Mercurial > public > mercurial-scm > hg
comparison mercurial/pure/charencode.py @ 45942:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 9f70512ae2cf |
children | d4ba4d51f85f |
comparison
equal
deleted
inserted
replaced
45941:346af7687c6f | 45942:89a2afe31e82 |
---|---|
19 except UnicodeDecodeError: | 19 except UnicodeDecodeError: |
20 return False | 20 return False |
21 | 21 |
22 | 22 |
23 def asciilower(s): | 23 def asciilower(s): |
24 '''convert a string to lowercase if ASCII | 24 """convert a string to lowercase if ASCII |
25 | 25 |
26 Raises UnicodeDecodeError if non-ASCII characters are found.''' | 26 Raises UnicodeDecodeError if non-ASCII characters are found.""" |
27 s.decode('ascii') | 27 s.decode('ascii') |
28 return s.lower() | 28 return s.lower() |
29 | 29 |
30 | 30 |
31 def asciiupper(s): | 31 def asciiupper(s): |
32 '''convert a string to uppercase if ASCII | 32 """convert a string to uppercase if ASCII |
33 | 33 |
34 Raises UnicodeDecodeError if non-ASCII characters are found.''' | 34 Raises UnicodeDecodeError if non-ASCII characters are found.""" |
35 s.decode('ascii') | 35 s.decode('ascii') |
36 return s.upper() | 36 return s.upper() |
37 | 37 |
38 | 38 |
39 _jsonmap = [] | 39 _jsonmap = [] |