Skip to content

Commit 269449f

Browse files
authored
MAINT: Don't format logs in log call. (#336)
1 parent 9bd9246 commit 269449f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

jupyter_core/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def load_config_file(self, suppress_errors=True):
216216
# self.raise_config_file_errors
217217
if (not suppress_errors) or self.raise_config_file_errors:
218218
raise
219-
self.log.warning("Error loading config file: %s" % config_file_name, exc_info=True)
219+
self.log.warning("Error loading config file: %s", config_file_name, exc_info=True)
220220

221221
# subcommand-related
222222
def _find_subcommand(self, name):

jupyter_core/migrate.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,16 @@ def migrate_dir(src, dst):
8282
"""Migrate a directory from src to dst"""
8383
log = get_logger()
8484
if not os.listdir(src):
85-
log.debug("No files in %s" % src)
85+
log.debug("No files in %s", src)
8686
return False
8787
if os.path.exists(dst):
8888
if os.listdir(dst):
8989
# already exists, non-empty
90-
log.debug("%s already exists" % dst)
90+
log.debug("%s already exists", dst)
9191
return False
9292
else:
9393
os.rmdir(dst)
94-
log.info(f"Copying {src} -> {dst}")
94+
log.info("Copying %s -> %s", src, dst)
9595
ensure_dir_exists(os.path.dirname(dst))
9696
shutil.copytree(src, dst, symlinks=True)
9797
return True
@@ -105,9 +105,9 @@ def migrate_file(src, dst, substitutions=None):
105105
log = get_logger()
106106
if os.path.exists(dst):
107107
# already exists
108-
log.debug("%s already exists" % dst)
108+
log.debug("%s already exists", dst)
109109
return False
110-
log.info(f"Copying {src} -> {dst}")
110+
log.info("Copying %s -> %s", src, dst)
111111
ensure_dir_exists(os.path.dirname(dst))
112112
shutil.copy(src, dst)
113113
if substitutions:
@@ -131,7 +131,7 @@ def migrate_one(src, dst):
131131
elif os.path.isdir(src):
132132
return migrate_dir(src, dst)
133133
else:
134-
log.debug("Nothing to migrate for %s" % src)
134+
log.debug("Nothing to migrate for %s", src)
135135
return False
136136

137137

@@ -163,9 +163,9 @@ def migrate_static_custom(src, dst):
163163
custom_css_empty = css.startswith("/*") and css.endswith("*/")
164164

165165
if custom_js_empty:
166-
log.debug("Ignoring empty %s" % custom_js)
166+
log.debug("Ignoring empty %s", custom_js)
167167
if custom_css_empty:
168-
log.debug("Ignoring empty %s" % custom_css)
168+
log.debug("Ignoring empty %s", custom_css)
169169

170170
if custom_js_empty and custom_css_empty:
171171
# nothing to migrate
@@ -208,7 +208,7 @@ def migrate_config(name, env):
208208
migrated.append(src)
209209
else:
210210
# don't migrate empty config files
211-
log.debug("Not migrating empty config file: %s" % src)
211+
log.debug("Not migrating empty config file: %s", src)
212212
return migrated
213213

214214

0 commit comments

Comments
 (0)