Skip to content

Only call colorama.init if colorama is available#2032

Merged
staticdev merged 1 commit intoPyCQA:mainfrom
tomaarsen:hotfix/colorama_nameerror
Dec 12, 2022
Merged

Only call colorama.init if colorama is available#2032
staticdev merged 1 commit intoPyCQA:mainfrom
tomaarsen:hotfix/colorama_nameerror

Conversation

@tomaarsen
Copy link
Contributor

Resolves #2031

Hello!

Pull Request Overview

  • Only call colorama.init if colorama could be imported.

After this PR

After applying the reproduction steps from #2031, the command now terminates normally, as opposed to the NameError from before.

Let me know if you need anything else from me!

  • Tom Aarsen

Copy link
Collaborator

@staticdev staticdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomaarsen would you mind adding a changelog entry for 5.11.1 on changelog.md?

UPDATE: nvm.

@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Merging #2032 (c752a6c) into main (6525008) will decrease coverage by 0.03%.
The diff coverage is 50.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2032      +/-   ##
==========================================
- Coverage   98.83%   98.80%   -0.04%     
==========================================
  Files          38       38              
  Lines        3083     3084       +1     
  Branches      733      734       +1     
==========================================
  Hits         3047     3047              
  Misses         26       26              
- Partials       10       11       +1     

@staticdev staticdev merged commit 68f0a25 into PyCQA:main Dec 12, 2022
@tomaarsen
Copy link
Contributor Author

Apologies - I didn't see your request on time!

@tomaarsen tomaarsen deleted the hotfix/colorama_nameerror branch December 12, 2022 20:47
@hugovk
Copy link
Contributor

hugovk commented Feb 28, 2023

We're hitting this with the latest 6.0.0b2:

https://github.com/pytest-dev/pytest-cov/actions/runs/4284044499/jobs/7460448953

Please could you also include this in a new beta release?

Also, I couldn't find any tags for the 6.x beta releases on PyPI, please could you add those?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isort 5.11.0, NameError: name 'colorama' is not defined

3 participants