Skip to content

Commit 4c9c972

Browse files
authored
Audit uses of print (#261)
1 parent 2d7afd4 commit 4c9c972

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

jupyterlab_server/handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Copyright (c) Jupyter Development Team.
44
# Distributed under the terms of the Modified BSD License.
55
import os
6+
import warnings
67
from functools import lru_cache
78
from urllib.parse import urlparse
89

@@ -255,7 +256,7 @@ def add_handlers(handlers, extension_app):
255256
allowed_extensions_uris = settings_config.get("allowed_extensions_uris", "")
256257

257258
if (blocked_extensions_uris) and (allowed_extensions_uris):
258-
print(
259+
warnings.warn(
259260
"Simultaneous blocked_extensions_uris and allowed_extensions_uris is not supported. Please define only one of those."
260261
)
261262
import sys

jupyterlab_server/settings_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ def _get_overrides(app_settings_dir):
295295
path_overrides = json.load(fid)
296296
for plugin_id, config in path_overrides.items():
297297
recursive_update(overrides.setdefault(plugin_id, {}), config)
298-
print(overrides_path, overrides)
299298
except Exception as e:
300299
error = e
301300

jupyterlab_server/workspaces_app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""A workspace management CLI"""
22
import json
33
import sys
4+
import warnings
45
from pathlib import Path
56

67
from jupyter_core.application import JupyterApp
@@ -85,7 +86,7 @@ def initialize(self, *args, **kwargs):
8586

8687
def start(self):
8788
if len(self.extra_args) > 1:
88-
print("Too many arguments were provided for workspace export.")
89+
warnings.warn("Too many arguments were provided for workspace export.")
8990
self.exit(1)
9091

9192
raw = DEFAULT_WORKSPACE if not self.extra_args else self.extra_args[0]

0 commit comments

Comments
 (0)