summaryrefslogtreecommitdiff
path: root/astroid/modutils.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-02-17 23:19:05 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-02-17 23:51:41 +0100
commitea96fc4bce94673671958e15d17bbcd75914b3f9 (patch)
tree2c0872b4701f60f2469753f9793f7ac95a0b2475 /astroid/modutils.py
parent14395e6e5d9d75b6fe1f87a44b77cfe71a538083 (diff)
downloadastroid-git-ea96fc4bce94673671958e15d17bbcd75914b3f9.tar.gz
Move from % syntax to format or f-strings
This is possible with python 3.6
Diffstat (limited to 'astroid/modutils.py')
-rw-r--r--astroid/modutils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py
index 2541e127..05968c02 100644
--- a/astroid/modutils.py
+++ b/astroid/modutils.py
@@ -301,7 +301,7 @@ def modpath_from_file_with_callback(filename, path=None, is_package_cb=None):
return modpath
raise ImportError(
- "Unable to find module for %s in %s" % (filename, ", \n".join(sys.path))
+ "Unable to find module for {} in {}".format(filename, ", \n".join(sys.path))
)
@@ -495,7 +495,7 @@ def get_source_file(filename, include_no_ext=False):
filename = os.path.abspath(_path_from_filename(filename))
base, orig_ext = os.path.splitext(filename)
for ext in PY_SOURCE_EXTS:
- source_path = "%s.%s" % (base, ext)
+ source_path = f"{base}.{ext}"
if os.path.exists(source_path):
return source_path
if include_no_ext and not orig_ext and os.path.exists(base):