Skip to content
Snippets Groups Projects
Commit 60579063 authored by Robin Jarry's avatar Robin Jarry
Browse files

Fix individual modules import


When using scapy as a third party library, we do not "benefit" from the
loading routine that puts all symbols in the __builtin__ namespace. This
implies that all modules must be "importable" without any errors for
undefined symbols.

This patch fixes importing every scapy module individually. Some
circular imports were fixed (between inet6 and dhcp6).

Most errors were detected by using pylint with the right configuration
(scapy produces a *lot* of errors). Other errors were detected with the
following shell script:

    export PYTHONPATH=".:$PYTHONPATH"
    for f in $(find scapy/ -name '*.py'); do
        f=${f%/__init__.py}
        module=$(echo ${f%.py} | sed 's,/,.,g')
        python -c "import $module; print $module"
    done

Also, replace all implicit relative imports by absolute imports to avoid
surprises with some python versions.

Signed-off-by: default avatarRobin Jarry <robin.jarry@6wind.com>
parent 1e48e13f
No related branches found
No related tags found
No related merge requests found
Showing with 98 additions and 92 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment