File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,10 +145,10 @@ def __init__(
145145 self .key = m_dict .get ("key" )
146146
147147 # Replace unmatched optional groups with empty matches (for convenience).
148- self .conv_type = m_dict .get ("type" , "" )
149- self .flags = m_dict .get ("flags" , "" )
150- self .width = m_dict .get ("width" , "" )
151- self .precision = m_dict .get ("precision" , "" )
148+ self .conv_type = m_dict .get ("type" ) or ""
149+ self .flags = m_dict .get ("flags" ) or ""
150+ self .width = m_dict .get ("width" ) or ""
151+ self .precision = m_dict .get ("precision" ) or ""
152152
153153 # Used only for str.format() calls (it may be custom for types with __format__()).
154154 self .format_spec = m_dict .get ("format_spec" )
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ a = None # type: Any
6060[case testStringInterpolationInvalidPlaceholder]
6161'%W' % 1 # E: Unsupported format character "W"
6262'%b' % 1 # E: Format character "b" is only supported on bytes patterns
63+ '%(a)' % {'a': 1} # E: Unsupported format character ""
6364
6465[case testStringInterpolationWidth]
6566'%2f' % 3.14
You can’t perform that action at this time.
0 commit comments