summaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/query_parse.py
diff options
context:
space:
mode:
authorChristian Clauss <cclauss@me.com>2021-02-09 17:44:04 +0100
committerbnewbold <bnewbold@robocracy.org>2021-02-23 15:19:48 -0800
commit537659325664b47b01c24e82cb4a0e850cd129c0 (patch)
treebb7c93162d9f586a8bec17608cf7eceb11d47cf0 /fatcat_scholar/query_parse.py
parent5878aa63118388361f353ca4f2f6c49a14a58b56 (diff)
downloadfatcat-scholar-537659325664b47b01c24e82cb4a0e850cd129c0.tar.gz
fatcat-scholar-537659325664b47b01c24e82cb4a0e850cd129c0.zip
Modernize Python syntax with pyupgrade --py38-plus **/*.py
Diffstat (limited to 'fatcat_scholar/query_parse.py')
-rw-r--r--fatcat_scholar/query_parse.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/fatcat_scholar/query_parse.py b/fatcat_scholar/query_parse.py
index 0f5086b..8c49925 100644
--- a/fatcat_scholar/query_parse.py
+++ b/fatcat_scholar/query_parse.py
@@ -11,7 +11,7 @@ import shlex
def _clean_token(raw: str) -> str:
raw = raw.strip()
if not raw:
- return '"{}"'.format(raw)
+ return f'"{raw}"'
if len(raw.split()) > 1:
# has whitespace, will get quoted
return raw
@@ -19,11 +19,11 @@ def _clean_token(raw: str) -> str:
# is quoted already
return raw
if "/" in raw or raw.endswith(":") or raw.endswith("!") or raw.endswith("?"):
- return '"{}"'.format(raw)
+ return f'"{raw}"'
if raw.startswith("[") and raw.endswith("]"):
- return '"{}"'.format(raw)
+ return f'"{raw}"'
if raw.startswith("{") and raw.endswith("}"):
- return '"{}"'.format(raw)
+ return f'"{raw}"'
return raw