Skip to content

Commit

Permalink
Merge pull request #234 from encukou/trace-level
Browse files Browse the repository at this point in the history
Lib/ldap: Provide _trace_level and _trace_file in non-debug mode
  • Loading branch information
Christian Heimes authored and GitHub committed Mar 8, 2019
2 parents 7fb02c0 + be8e3c6 commit b66e56d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Lib/ldap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
_trace_file = open(_trace_file, 'a')
atexit.register(_trace_file.close)
_trace_stack_limit = None
else:
# Any use of the _trace attributes should be guarded by `if __debug__`,
# so they should not be needed here.
# But, providing different API for debug mode is unnecessarily fragile.
_trace_level = 0
_trace_file = sys.stderr
_trace_stack_limit = None

import _ldap
assert _ldap.__version__==__version__, \
Expand Down

0 comments on commit b66e56d

Please sign in to comment.