diff contrib/byteify-strings.py @ 45957: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 bc9a9016467d
children 6000f5b25c9b
line wrap: on
line diff
--- a/contrib/byteify-strings.py	Fri Nov 27 17:00:00 2020 -0500
+++ b/contrib/byteify-strings.py	Fri Nov 27 17:03:29 2020 -0500
@@ -213,15 +213,19 @@
             fn = t.string
 
             # *attr() builtins don't accept byte strings to 2nd argument.
-            if fn in (
-                'getattr',
-                'setattr',
-                'hasattr',
-                'safehasattr',
-                'wrapfunction',
-                'wrapclass',
-                'addattr',
-            ) and (opts['allow-attr-methods'] or not _isop(i - 1, '.')):
+            if (
+                fn
+                in (
+                    'getattr',
+                    'setattr',
+                    'hasattr',
+                    'safehasattr',
+                    'wrapfunction',
+                    'wrapclass',
+                    'addattr',
+                )
+                and (opts['allow-attr-methods'] or not _isop(i - 1, '.'))
+            ):
                 arg1idx = _findargnofcall(1)
                 if arg1idx is not None:
                     _ensuresysstr(arg1idx)