diff --git a/pyftpdlib/handlers.py b/pyftpdlib/handlers.py index 8cf116ab..4d66ed22 100644 --- a/pyftpdlib/handlers.py +++ b/pyftpdlib/handlers.py @@ -56,7 +56,7 @@ from .log import logger -if sys.version_info[:2] >= (3, 12): +if PY3: from . import _asynchat as asynchat else: import asynchat diff --git a/pyftpdlib/ioloop.py b/pyftpdlib/ioloop.py index 95e2f70b..b6fdba39 100644 --- a/pyftpdlib/ioloop.py +++ b/pyftpdlib/ioloop.py @@ -65,6 +65,8 @@ def handle_accepted(self, sock, addr): import time import traceback +from ._compat import PY3 + try: import threading @@ -78,7 +80,7 @@ def handle_accepted(self, sock, addr): from .log import logger -if sys.version_info[:2] >= (3, 12): +if PY3: from . import _asynchat as asynchat from . import _asyncore as asyncore else: