kapatıldı Algılama: tercüman kapatmaya sırasındaTercüman Bu böcek tarafından vuruldu cin iplik
http://bugs.python.org/issue1856 Daemon ipler segfault.
Şimdi bu hatayı kodlamak için bir yol arıyorum. Şu anda
kod şuna benzer:
while True:
do_something()
time.sleep(interval)
tercüman() do_something önce hala kullanılabilir olup olmadığını kontrol etmek için bir yolu var mı?
Veya mythread.setDaemon (True) ve ana iş parçacığının çıkıp çıkmadığını kontrol etmek daha iyi mi?
import sys as _sys
class Thread(_Verbose):
def _bootstrap_inner(self):
# some code
# If sys.stderr is no more (most likely from interpreter
# shutdown) use self._stderr. Otherwise still use sys (as in
# _sys) in case sys.stderr was redefined since the creation of
# self.
if _sys:
_sys.stderr.write("Exception in thread %s:\n%s\n" %
(self.name, _format_exc()))
else:
# some code
yararlı olabilir:
İlgili: http://stackoverflow.com/questions/16731115/how-to-debug-a-python-seg-fault – guettli