Skip to content

Commit

Permalink
Avoid getting into infinite recursion when clearing off _pending_sign…
Browse files Browse the repository at this point in the history
…al. Better to lose a _pending_signal.

The alternative is to use a signal mask but that is not so portable (we can still add that for linux tho).

Ref #294.
  • Loading branch information
ionelmc committed May 15, 2019
1 parent ad3ee90 commit 7cdd4c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pytest_cov/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def cleanup():
_active_cov = None
_cleanup_in_progress = False
if _pending_signal:
_signal_cleanup_handler(*_pending_signal)
_pending_signal = None
_signal_cleanup_handler(*_pending_signal)


multiprocessing_finish = cleanup # in case someone dared to use this internal
Expand Down

1 comment on commit 7cdd4c9

@PetrochukM
Copy link

Choose a reason for hiding this comment

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

This change causes an error:TypeError: _signal_cleanup_handler() argument after * must be an iterable, not NoneType.

Something like this should fix it:

    if _pending_signal:
        _temp_pending_signal = _pending_signal
        _pending_signal = None
        _signal_cleanup_handler(*_temp_pending_signal)

Please sign in to comment.