diff options
author | John Turner <jturner.usa@gmail.com> | 2025-09-07 21:47:50 -0400 |
---|---|---|
committer | John Turner <jturner.usa@gmail.com> | 2025-09-07 21:47:50 -0400 |
commit | 5e0f76c0e24652764bf6446a13623aba540f38b6 (patch) | |
tree | 89866b643d0f1a844bce054e4ff0bdbfc9e3c1ac | |
parent | 6e259c0ec40a8d48cdc5a2a2d21c1dd0ca40039f (diff) | |
download | pypaste-5e0f76c0e24652764bf6446a13623aba540f38b6.tar.gz |
print warning when failing to find lexer
-rw-r--r-- | pypaste/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pypaste/__init__.py b/pypaste/__init__.py index e8e6272..13f84b8 100644 --- a/pypaste/__init__.py +++ b/pypaste/__init__.py @@ -57,8 +57,8 @@ def pygmentize( if syntax is not None: try: lexer = get_lexer_by_name(syntax) - except Exception as e: - print(e, file=sys.stderr) + except Exception: + log_warning(f"failed to find lexer for {syntax}") lexer = guess_lexer(content) else: lexer = guess_lexer(content) |