Skip to content

Commit

Permalink
Issue #85: Remove Python 2.7 support on Amazon-dash v2.0.0 (scan.py t…
Browse files Browse the repository at this point in the history
…ypes)
  • Loading branch information
Nekmo committed Sep 4, 2018
1 parent 733fe04 commit 3b5a937
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions amazon_dash/scan.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import logging
from typing import Callable, Any

from amazon_dash.exceptions import SocketPermissionError

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *


try:
PermissionError
except NameError:
import socket
PermissionError = socket.error


def scan_devices(fn, lfilter, iface=None):
"""Sniff packages
def scan_devices(fn: Callable[[Packet], Any], lfilter: Callable[[Packet], bool],
iface: Union[str, None]=None) -> None:
"""Sniff packages loop
:param fn: callback on packet
:param lfilter: filter packages
:return: loop
:param iface: Network interface to listen.
"""
try:
sniff(prn=fn, store=0,
Expand Down

0 comments on commit 3b5a937

Please sign in to comment.