orweis / winpcapy

A Modern Python wrapper for WinPcap
GNU General Public License v2.0
76 stars 23 forks source link

`from collections import Callable` is the `collections` module instead of the correct `typing` module #21

Open DragonlordNewb opened 1 year ago

DragonlordNewb commented 1 year ago

In winpcapy.py, the name Callable is imported from collections at the top. However I think that it's supposed to be typing; the code throws an error when I replace the name, and Callable is a type from typings.

orweis commented 1 year ago

It's something that has changed between Python versions (after 3.7) https://docs.python.org/3.7/library/collections.abc.html#module-collections.abc

You're welcome to open a PR to fix this (maybe have a try except block to try the older version import for backward compatibility)