@@ -356,24 +356,8 @@ def transform(self, lines: List[str]):
356356class SystemAssign (TokenTransformBase ):
357357 """Transformer for assignments from system commands (a = !foo)"""
358358 @classmethod
359- def find_pre_312 (cls , tokens_by_line ):
360- for line in tokens_by_line :
361- assign_ix = _find_assign_op (line )
362- if (assign_ix is not None ) \
363- and not line [assign_ix ].line .strip ().startswith ('=' ) \
364- and (len (line ) >= assign_ix + 2 ) \
365- and (line [assign_ix + 1 ].type == tokenize .ERRORTOKEN ):
366- ix = assign_ix + 1
367-
368- while ix < len (line ) and line [ix ].type == tokenize .ERRORTOKEN :
369- if line [ix ].string == '!' :
370- return cls (line [ix ].start )
371- elif not line [ix ].string .isspace ():
372- break
373- ix += 1
374-
375- @classmethod
376- def find_post_312 (cls , tokens_by_line ):
359+ def find (cls , tokens_by_line ):
360+ """Find the first system assignment (a = !foo) in the cell."""
377361 for line in tokens_by_line :
378362 assign_ix = _find_assign_op (line )
379363 if (
@@ -385,13 +369,6 @@ def find_post_312(cls, tokens_by_line):
385369 ):
386370 return cls (line [assign_ix + 1 ].start )
387371
388- @classmethod
389- def find (cls , tokens_by_line ):
390- """Find the first system assignment (a = !foo) in the cell."""
391- if sys .version_info < (3 , 12 ):
392- return cls .find_pre_312 (tokens_by_line )
393- return cls .find_post_312 (tokens_by_line )
394-
395372 def transform (self , lines : List [str ]):
396373 """Transform a system assignment found by the ``find()`` classmethod.
397374 """
0 commit comments