Skip to content

Commit

Permalink
suppress DeprecationWarning because of asyncore import
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jul 5, 2024
1 parent eef1696 commit f7a4478
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ E: git@torypages.com
C: Canada
D: Command line argument enhancements


N: Tahir Ijaz
W: https://github.com/tahirijaz24
D: issue 201, 435

N: Sandro
W: https://github.com/penguinpee
D: issue 637
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Version: 2.0.0 - (IN DEVELOPMENT)
**Enhancements**

* #629: removed Python 2.7 support.
* #637: remove copies of asyncore.py and asynchat.py. Use backports from PYPI
instead. (patch by @penguinpee)

**Notes about backward compatibility**

Expand Down
8 changes: 6 additions & 2 deletions pyftpdlib/ioloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def handle_accepted(self, sock, addr):
IOLoop.instance().loop()
"""

import asynchat
import asyncore
import errno
import heapq
import os
Expand All @@ -67,13 +65,19 @@ def handle_accepted(self, sock, addr):
import threading
import time
import traceback
import warnings

from .log import config_logging
from .log import debug
from .log import is_logging_configured
from .log import logger


with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
import asynchat
import asyncore

timer = getattr(time, 'monotonic', time.time)
_read = asyncore.read
_write = asyncore.write
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def main():
install_requires=[
"pyasyncore;python_version>='3.12'",
"pyasynchat;python_version>='3.12'",
],
],
extras_require=extras_require,
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down

0 comments on commit f7a4478

Please sign in to comment.