File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 5151
5252class AttrCleaner :
5353 """A context manager that tries to make an object not exhibit side-effects
54- on attribute lookup."""
54+ on attribute lookup."""
5555
5656 def __init__ (self , obj ):
5757 self .obj = obj
@@ -126,9 +126,9 @@ def parsekeywordpairs(signature):
126126 continue
127127
128128 if token is Token .Punctuation :
129- if value in [ "(" , "{" , "[" ] :
129+ if value in ( "(" , "{" , "[" ) :
130130 parendepth += 1
131- elif value in [ ")" , "}" , "]" ] :
131+ elif value in ( ")" , "}" , "]" ) :
132132 parendepth -= 1
133133 elif value == ":" and parendepth == - 1 :
134134 # End of signature reached
@@ -143,11 +143,7 @@ def parsekeywordpairs(signature):
143143 if value and (parendepth > 0 or value .strip ()):
144144 substack .append (value )
145145
146- d = {}
147- for item in stack :
148- if len (item ) >= 3 :
149- d [item [0 ]] = "" .join (item [2 :])
150- return d
146+ return {item [0 ]: "" .join (item [2 :] for item in stack if len (item ) >= 3 )}
151147
152148
153149def fixlongargs (f , argspec ):
You can’t perform that action at this time.
0 commit comments