fix for newer versions of Python3

This commit is contained in:
Kashiko Koibumi 2024-05-30 11:15:11 +09:00
parent 67004f39b5
commit f04a7882fd
No known key found for this signature in database
GPG Key ID: 8F06E069E37C40C4
3 changed files with 10 additions and 3 deletions

View File

@ -808,7 +808,7 @@ class MyForm(settingsmixin.SMainWindow):
elif TTL > 28 * 24 * 60 * 60: # 28 days elif TTL > 28 * 24 * 60 * 60: # 28 days
TTL = 28 * 24 * 60 * 60 TTL = 28 * 24 * 60 * 60
self.ui.horizontalSliderTTL.setSliderPosition( self.ui.horizontalSliderTTL.setSliderPosition(
(TTL - 3600) ** (1 / 3.199)) int((TTL - 3600) ** (1 / 3.199)))
self.updateHumanFriendlyTTLDescription(TTL) self.updateHumanFriendlyTTLDescription(TTL)
self.ui.horizontalSliderTTL.valueChanged.connect(self.updateTTL) self.ui.horizontalSliderTTL.valueChanged.connect(self.updateTTL)

View File

@ -4,7 +4,10 @@ Folder tree and messagelist widgets definitions.
# pylint: disable=too-many-arguments # pylint: disable=too-many-arguments
# pylint: disable=attribute-defined-outside-init # pylint: disable=attribute-defined-outside-init
try:
from cgi import escape from cgi import escape
except ImportError:
from html import escape
from unqstr import ustr, unic from unqstr import ustr, unic
from dbcompat import dbstr from dbcompat import dbstr

View File

@ -23,7 +23,11 @@ def doCleanShutdown():
objectProcessorQueue.put(('checkShutdownVariable', 'no data')) objectProcessorQueue.put(('checkShutdownVariable', 'no data'))
for thread in threading.enumerate(): for thread in threading.enumerate():
if thread.isAlive() and isinstance(thread, StoppableThread): try:
alive = thread.isAlive()
except AttributeError:
alive = thread.is_alive()
if alive and isinstance(thread, StoppableThread):
thread.stopThread() thread.stopThread()
UISignalQueue.put(( UISignalQueue.put((