Fix thread stop for Py3
This commit is contained in:
parent
9662a7f779
commit
7decda3297
6
test.py
6
test.py
|
@ -29,6 +29,7 @@ import unittest
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import paramiko
|
import paramiko
|
||||||
import threading
|
import threading
|
||||||
|
from paramiko.py3compat import PY3
|
||||||
|
|
||||||
sys.path.append('tests')
|
sys.path.append('tests')
|
||||||
|
|
||||||
|
@ -148,7 +149,10 @@ def main():
|
||||||
# TODO: make that not a problem, jeez
|
# TODO: make that not a problem, jeez
|
||||||
for thread in threading.enumerate():
|
for thread in threading.enumerate():
|
||||||
if thread is not threading.currentThread():
|
if thread is not threading.currentThread():
|
||||||
thread._Thread__stop()
|
if PY3:
|
||||||
|
thread._stop()
|
||||||
|
else:
|
||||||
|
thread._Thread__stop()
|
||||||
# Exit correctly
|
# Exit correctly
|
||||||
if not result.wasSuccessful():
|
if not result.wasSuccessful():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Reference in New Issue