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

Remove redefinition of NullHandler #518

Merged
merged 2 commits into from
Aug 28, 2019
Merged

Conversation

mdickinson
Copy link
Member

Some cleanups to the top-level __init__.py:

  • NullHandler is in the standard library since Python 2.7, and we don't support Python 2.6. Remove the redefinition and use the std. lib. version
  • Add copyright header.

@@ -12,19 +15,6 @@
# Add a NullHandler so 'traits' loggers don't complain when they get used.
import logging

logging.getLogger("traits").addHandler(logging.NullHandler())
Copy link
Contributor

@rahulporuri rahulporuri Aug 27, 2019

Choose a reason for hiding this comment

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

q : why use "traits" instead of __name__?

Copy link
Member Author

Choose a reason for hiding this comment

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

More explicit; no need to think hard about whether __name__ might ever possibly have the value "__main__".

Copy link
Member Author

Choose a reason for hiding this comment

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

Having said that, I don't feel strongly about the change, and the __name__ version has greater copy-and-paste value.

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

LGTM expect for a minor question.

@mdickinson
Copy link
Member Author

I've changed back to __name__. Merging when CI completes.

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@6586600). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #518   +/-   ##
=========================================
  Coverage          ?   65.31%           
=========================================
  Files             ?       44           
  Lines             ?     7050           
  Branches          ?     1415           
=========================================
  Hits              ?     4605           
  Misses            ?     2022           
  Partials          ?      423
Impacted Files Coverage Δ
traits/__init__.py 75% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6586600...61fa74e. Read the comment docs.

1 similar comment
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@6586600). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #518   +/-   ##
=========================================
  Coverage          ?   65.31%           
=========================================
  Files             ?       44           
  Lines             ?     7050           
  Branches          ?     1415           
=========================================
  Hits              ?     4605           
  Misses            ?     2022           
  Partials          ?      423
Impacted Files Coverage Δ
traits/__init__.py 75% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6586600...61fa74e. Read the comment docs.

@mdickinson mdickinson merged commit 8eede3b into master Aug 28, 2019
@mdickinson mdickinson deleted the remove-null-handler-definition branch August 28, 2019 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants