Skip to content

Commit

Permalink
Remove f-string compatibility code, no longer needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 5, 2020
1 parent c31bd7c commit c4938de
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions pip_run/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import tokenize
import itertools
import io
import re


try:
Expand Down Expand Up @@ -88,7 +87,7 @@ def read(self):
return deps

def _read(self, var_name):
mod = ast.parse(self._fstring_compat(self.script))
mod = ast.parse(self.script)
(node,) = (
node
for node in mod.body
Expand All @@ -99,20 +98,6 @@ def _read(self, var_name):
)
return ast.literal_eval(node.value)

@staticmethod
def _fstring_compat(script):
if sys.version_info > (3, 6):
return script

removed = re.sub(
r'^\s*#.*coding:\s*future_fstrings.*$', '', script, flags=re.MULTILINE
)

def strip_f(match):
return match.group(0)[1:]

return re.sub(r'\bf[\'"]', strip_f, removed)


def run(cmdline):
"""
Expand Down

0 comments on commit c4938de

Please sign in to comment.