Mercurial > public > mercurial-scm > hg
comparison mercurial/win32.py @ 43503:313e3a279828
cleanup: remove pointless r-prefixes on double-quoted strings
This is only double-quoted strings. I'll do single-quoted strings as a
second step. These had existed because our source transformer didn't
turn r"" into b"", so we had tagged some strings as r-strings to get
"native" strings on both Pythons. Now that the transformer is gone, we
can dispense with this nonsense.
Methodology:
I ran
hg locate 'set:added() or modified() or clean()' | egrep '.*\.py$' | xargs egrep --color=never -n -- \[\^a-z\]r\"\[\^\"\\\\\]\*\"\[\^\"\]
in an emacs grep-mode buffer, and then used a keyboard macro to
iterate over the results and remove the r prefix as needed.
# skip-blame removing unneeded r prefixes left over from Python 3 migration.
Differential Revision: https://phab.mercurial-scm.org/D7305
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 07 Nov 2019 13:18:19 -0500 |
parents | 687b865b95ad |
children | 9f70512ae2cf |
comparison
equal
deleted
inserted
replaced
43502:c093cc6e6c99 | 43503:313e3a279828 |
---|---|
165 PKCS_7_ASN_ENCODING = 0x00010000 | 165 PKCS_7_ASN_ENCODING = 0x00010000 |
166 | 166 |
167 # These structs are only complete enough to achieve what we need. | 167 # These structs are only complete enough to achieve what we need. |
168 class CERT_CHAIN_CONTEXT(ctypes.Structure): | 168 class CERT_CHAIN_CONTEXT(ctypes.Structure): |
169 _fields_ = ( | 169 _fields_ = ( |
170 (r"cbSize", _DWORD), | 170 ("cbSize", _DWORD), |
171 # CERT_TRUST_STATUS struct | 171 # CERT_TRUST_STATUS struct |
172 (r"dwErrorStatus", _DWORD), | 172 ("dwErrorStatus", _DWORD), |
173 (r"dwInfoStatus", _DWORD), | 173 ("dwInfoStatus", _DWORD), |
174 (r"cChain", _DWORD), | 174 ("cChain", _DWORD), |
175 (r"rgpChain", ctypes.c_void_p), | 175 ("rgpChain", ctypes.c_void_p), |
176 (r"cLowerQualityChainContext", _DWORD), | 176 ("cLowerQualityChainContext", _DWORD), |
177 (r"rgpLowerQualityChainContext", ctypes.c_void_p), | 177 ("rgpLowerQualityChainContext", ctypes.c_void_p), |
178 (r"fHasRevocationFreshnessTime", _BOOL), | 178 ("fHasRevocationFreshnessTime", _BOOL), |
179 (r"dwRevocationFreshnessTime", _DWORD), | 179 ("dwRevocationFreshnessTime", _DWORD), |
180 ) | 180 ) |
181 | 181 |
182 | 182 |
183 class CERT_USAGE_MATCH(ctypes.Structure): | 183 class CERT_USAGE_MATCH(ctypes.Structure): |
184 _fields_ = ( | 184 _fields_ = ( |
185 (r"dwType", _DWORD), | 185 ("dwType", _DWORD), |
186 # CERT_ENHKEY_USAGE struct | 186 # CERT_ENHKEY_USAGE struct |
187 (r"cUsageIdentifier", _DWORD), | 187 ("cUsageIdentifier", _DWORD), |
188 (r"rgpszUsageIdentifier", ctypes.c_void_p), # LPSTR * | 188 ("rgpszUsageIdentifier", ctypes.c_void_p), # LPSTR * |
189 ) | 189 ) |
190 | 190 |
191 | 191 |
192 class CERT_CHAIN_PARA(ctypes.Structure): | 192 class CERT_CHAIN_PARA(ctypes.Structure): |
193 _fields_ = ( | 193 _fields_ = ( |
194 (r"cbSize", _DWORD), | 194 ("cbSize", _DWORD), |
195 (r"RequestedUsage", CERT_USAGE_MATCH), | 195 ("RequestedUsage", CERT_USAGE_MATCH), |
196 (r"RequestedIssuancePolicy", CERT_USAGE_MATCH), | 196 ("RequestedIssuancePolicy", CERT_USAGE_MATCH), |
197 (r"dwUrlRetrievalTimeout", _DWORD), | 197 ("dwUrlRetrievalTimeout", _DWORD), |
198 (r"fCheckRevocationFreshnessTime", _BOOL), | 198 ("fCheckRevocationFreshnessTime", _BOOL), |
199 (r"dwRevocationFreshnessTime", _DWORD), | 199 ("dwRevocationFreshnessTime", _DWORD), |
200 (r"pftCacheResync", ctypes.c_void_p), # LPFILETIME | 200 ("pftCacheResync", ctypes.c_void_p), # LPFILETIME |
201 (r"pStrongSignPara", ctypes.c_void_p), # PCCERT_STRONG_SIGN_PARA | 201 ("pStrongSignPara", ctypes.c_void_p), # PCCERT_STRONG_SIGN_PARA |
202 (r"dwStrongSignFlags", _DWORD), | 202 ("dwStrongSignFlags", _DWORD), |
203 ) | 203 ) |
204 | 204 |
205 | 205 |
206 # types of parameters of C functions used (required by pypy) | 206 # types of parameters of C functions used (required by pypy) |
207 | 207 |
730 break | 730 break |
731 except OSError as e: | 731 except OSError as e: |
732 if e.errno != errno.EEXIST: | 732 if e.errno != errno.EEXIST: |
733 raise | 733 raise |
734 else: | 734 else: |
735 raise IOError(errno.EEXIST, r"No usable temporary filename found") | 735 raise IOError(errno.EEXIST, "No usable temporary filename found") |
736 | 736 |
737 try: | 737 try: |
738 os.unlink(temp) | 738 os.unlink(temp) |
739 except OSError: | 739 except OSError: |
740 # The unlink might have failed because the READONLY attribute may heave | 740 # The unlink might have failed because the READONLY attribute may heave |