From c90cf42d7ce0e529af677e082ab651180339084b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Langa?= Date: Fri, 16 Mar 2018 21:47:15 -0700 Subject: [PATCH] blib2to3: Never put prefixes on DEDENT leaves --- blib2to3/pgen2/driver.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blib2to3/pgen2/driver.py b/blib2to3/pgen2/driver.py index cbc58e7..eabc72b 100644 --- a/blib2to3/pgen2/driver.py +++ b/blib2to3/pgen2/driver.py @@ -69,11 +69,16 @@ class Driver(object): if debug: self.logger.debug("%s %r (prefix=%r)", token.tok_name[type], value, prefix) + if type == token.DEDENT: + _prefix = prefix + prefix = "" if p.addtoken(type, value, (prefix, start)): if debug: self.logger.debug("Stop.") break prefix = "" + if type == token.DEDENT: + prefix = _prefix lineno, column = end if value.endswith("\n"): lineno += 1 -- 2.39.5