mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-06 16:50:09 +08:00
19 lines
426 B
Python
19 lines
426 B
Python
import pdb
|
|
import sys
|
|
|
|
class ForkedPdb(pdb.Pdb):
|
|
"""A Pdb subclass that may be used
|
|
from a forked multiprocessing child
|
|
|
|
"""
|
|
def interaction(self, *args, **kwargs):
|
|
_stdin = sys.stdin
|
|
try:
|
|
sys.stdin = open('/dev/stdin')
|
|
pdb.Pdb.interaction(self, *args, **kwargs)
|
|
finally:
|
|
sys.stdin = _stdin
|
|
|
|
|
|
class IncompatibleArgumentsException(Exception):
|
|
pass |