Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConsoleRenderer: default to colorless when colorama is unavailable #215

Merged
merged 2 commits into from Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/structlog/dev.py
Expand Up @@ -126,7 +126,7 @@ class ConsoleRenderer(object):
def __init__(
self,
pad_event=_EVENT_WIDTH,
colors=True,
colors=_has_colorama,
force_colors=False,
repr_native_str=False,
level_styles=None,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dev.py
Expand Up @@ -56,7 +56,7 @@ def test_missing_colorama(self):
colorama is missing.
"""
with pytest.raises(SystemError) as e:
dev.ConsoleRenderer()
dev.ConsoleRenderer(colors=True)

assert (
"ConsoleRenderer with `colors=True` requires the colorama package "
Expand Down