Skip to content

Commit

Permalink
fixed timeout for python 3.11 (#958)
Browse files Browse the repository at this point in the history
Signed-off-by: yiliu30 <yi4.liu@intel.com>
  • Loading branch information
yiliu30 committed Jun 12, 2023
1 parent 43aeed2 commit 6fa0532
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion neural_compressor/utils/utility.py
Expand Up @@ -136,7 +136,9 @@ def _singleton(*args, **kw):
def time_limit(seconds):
"""Limit the time for context execution."""
if seconds == 0:
seconds = threading.TIMEOUT_MAX
#seconds = threading.TIMEOUT_MAX
# TODO WA for fixed the crash for py 3.11.3
seconds = 3600 * 24 * 365
timer = threading.Timer(seconds, lambda: _thread.interrupt_main())
timer.start()
try:
Expand Down

0 comments on commit 6fa0532

Please sign in to comment.