task: Fix memory leak related to Python 3 signal API changes

Python 3's signal.py API does not properly support custom signal handlers. An exception is created every frame because of this, which fills up the memory of the application.

Closes #873
This commit is contained in:
Derzsi Dániel 2020-02-27 15:09:28 +02:00 committed by rdb
parent 4383fceba2
commit eccfce4606

View File

@ -17,9 +17,13 @@ from direct.showbase.MessengerGlobal import messenger
import types
import random
import importlib
import sys
try:
import signal
if sys.version_info >= (3, 0):
import _signal as signal
else:
import signal
except ImportError:
signal = None