Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e3c66c0

Browse files
committed
conditional register_at_fork
1 parent 8e7ebe4 commit e3c66c0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

IPython/core/history.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,8 @@ def __init__(
703703
self.hist_file = ":memory:"
704704
else:
705705
self.using_thread = True
706-
os.register_at_fork(before=self._stop_thread)
706+
if hasattr(os, "register_at_fork"):
707+
os.register_at_fork(before=self._stop_thread)
707708
self._instances.add(self)
708709
assert len(HistoryManager._instances) <= HistoryManager._max_inst, (
709710
len(HistoryManager._instances),

0 commit comments

Comments
 (0)