Skip to content

Conversation

casperdcl
Copy link
Member

@casperdcl casperdcl commented Jun 3, 2020

casperdcl and others added 2 commits June 3, 2020 10:30
Python 3.9 finally removed sys.setcheckinterval().  While the package
apparently tried to account for that, the logic is flawed and the second
getattr() raises an AttributeError even if its result is never used.
This caused tests to fail:

      File "/tmp/tqdm/tqdm/tests/tests_tqdm.py", line 126, in pretest
        getattr(sys, 'setswitchinterval', getattr(sys, 'setcheckinterval'))(100)
    AttributeError: module 'sys' has no attribute 'setcheckinterval'

Refactor the code into a try/except construct that does not execute
the setcheckinterval() branch unless setswitchinterval() is actually
missing.  While at it, scale the arguments a bit -- the current version
used either 100 instructions or 100 seconds that were rather of very
different magnitudes.
@casperdcl casperdcl added p0-bug-critical ☢ Exception rasing p3-enhancement 🔥 Much new such feature question/docs ‽ Documentation clarification candidate submodule ⊂ Periphery/subclasses to-merge ↰ Imminent synchronisation ⇶ Multi-thread/processing labels Jun 3, 2020
@casperdcl casperdcl added this to the v5.0.0 milestone Jun 3, 2020
@casperdcl casperdcl self-assigned this Jun 3, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2020

Codecov Report

Merging #984 into master will decrease coverage by 0.17%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #984      +/-   ##
==========================================
- Coverage   87.08%   86.90%   -0.18%     
==========================================
  Files          21       21              
  Lines        1254     1260       +6     
  Branches      215      215              
==========================================
+ Hits         1092     1095       +3     
- Misses        141      144       +3     
  Partials       21       21              

@casperdcl casperdcl changed the title next release v4.47.0 next release v4.46.1 Jun 3, 2020
@casperdcl casperdcl merged commit 1e0bb74 into master Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p0-bug-critical ☢ Exception rasing p3-enhancement 🔥 Much new such feature question/docs ‽ Documentation clarification candidate submodule ⊂ Periphery/subclasses synchronisation ⇶ Multi-thread/processing to-merge ↰ Imminent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'TqdmCallback' object has no attribute '_implements_train_batch_hooks' thread_map should be min(32, cpu count), not max
4 participants