File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1320,6 +1320,10 @@ def fix_e721(self, result):
13201320 isinstance_stmt = " not isinstance"
13211321
13221322 _type_comp = f"{ _target_obj } , { target [:start ]} "
1323+ indent_match = re .match (r'^\s+' , target )
1324+ indent_str = ""
1325+ if indent_match :
1326+ indent_str = indent_match .group ()
13231327
13241328 _prefix_tmp = target [:start ].split ()
13251329 if len (_prefix_tmp ) >= 1 :
@@ -1340,7 +1344,7 @@ def fix_e721(self, result):
13401344 cmp_b = _suffix_type_match .groups ()[0 ]
13411345 _type_comp = f"{ _target_obj } , { cmp_b } "
13421346
1343- fix_line = f"{ _prefix } { isinstance_stmt } ({ _type_comp } ){ _suffix } "
1347+ fix_line = f"{ indent_str } { _prefix } { isinstance_stmt } ({ _type_comp } ){ _suffix } "
13441348 self .source [line_index ] = fix_line
13451349
13461350 def fix_e722 (self , result ):
You can’t perform that action at this time.
0 commit comments