More 3.6+ fstring bugs

This commit is contained in:
rocky
2019-05-08 08:57:30 -04:00
parent 65307f257c
commit b05500dd49
4 changed files with 6 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -38,3 +38,7 @@ filename = '.'
source = 'foo' source = 'foo'
source = (f"__file__ = r'''{os.path.abspath(filename)}'''\n" source = (f"__file__ = r'''{os.path.abspath(filename)}'''\n"
+ source + "\ndel __file__") + source + "\ndel __file__")
# From 3.7.3 datalasses.py
log_rounds = 5
assert "05$" == f'{log_rounds:02d}$'

View File

@@ -464,7 +464,8 @@ def customize_for_version36(self, version):
elif subnode == 'fstring_single': elif subnode == 'fstring_single':
f_conversion(subnode) f_conversion(subnode)
data = self.traverse(subnode, indent='') data = self.traverse(subnode, indent='')
data = strip_quotes(data[1:]) if data[0:1] == 'f':
data = strip_quotes(data[1:])
result += data result += data
pass pass
else: else: