Skip to content

Commit df3fcf9

Browse files
committed
Don't use f-strings
Not supported in <Python3.6
1 parent df0eef9 commit df3fcf9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/python_minifier/f_string.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def str_for(self, s, quote):
157157
escaped += '}}'
158158
elif ord(c) < 32 and c not in '\n\r\t':
159159
# Escape other control characters
160-
escaped += f'\\x{ord(c):02x}'
160+
escaped += '\\x{:02x}'.format(ord(c))
161161
else:
162162
escaped += c
163163
return escaped
@@ -444,7 +444,7 @@ def str_for(self, s):
444444
escaped += '\\r'
445445
elif ord(c) < 32 and c not in '\t\n':
446446
# Escape other control characters except tab, newline
447-
escaped += f'\\x{ord(c):02x}'
447+
escaped += '\\x{:02x}'.format(ord(c))
448448
else:
449449
escaped += c
450450
return escaped
@@ -515,7 +515,7 @@ def _literals(self):
515515
elif 32 <= b <= 126: # printable ASCII
516516
literal += chr(b)
517517
else: # other non-printable characters
518-
literal += f'\\x{b:02x}'
518+
literal += '\\x{:02x}'.format(b)
519519

520520
if literal:
521521
literal += self.current_quote

0 commit comments

Comments
 (0)