knipknap / exscript

A Python module making Telnet and SSH easy
MIT License
367 stars 136 forks source link

SigIntWatcher.child is tested but may not exists #199

Closed u1735067 closed 5 years ago

u1735067 commented 5 years ago

Hello,

In SigIntWatcher, the init function is testing self.child (https://github.com/knipknap/exscript/blob/v2.6/Exscript/util/sigint.py#L62), but it may not exists, so the call ends with:

Traceback (most recent call last):
  File "...\Scripts\exscript", line 585, in <module>
    SigIntWatcher()
  File "...\site-packages\Exscript\util\sigint.py", line 62, in __init__
    if self.child == 0:
AttributeError: 'SigIntWatcher' object has no attribute 'child'

I guess a default value should be initialized, or set in the except clauses.

knipknap commented 5 years ago

Fixed in master, see above.