mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Get rid of ndiff.py symlink.
This existed only to allow importing the ndiff program as a module for the ndifftest.py program. I found another way to do that.
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
ndiff
|
|
||||||
@@ -3,12 +3,20 @@
|
|||||||
# Unit tests for Ndiff.
|
# Unit tests for Ndiff.
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
import StringIO
|
import StringIO
|
||||||
|
|
||||||
# The ndiff.py symlink exists so we can do this.
|
import imp
|
||||||
from ndiff import *
|
dont_write_bytecode = sys.dont_write_bytecode
|
||||||
|
sys.dont_write_bytecode = True
|
||||||
|
ndiff = imp.load_source("ndiff", "ndiff")
|
||||||
|
for x in dir(ndiff):
|
||||||
|
if not x.startswith("_"):
|
||||||
|
globals()[x] = getattr(ndiff, x)
|
||||||
|
sys.dont_write_bytecode = dont_write_bytecode
|
||||||
|
del dont_write_bytecode
|
||||||
|
|
||||||
class scan_test(unittest.TestCase):
|
class scan_test(unittest.TestCase):
|
||||||
"""Test the Scan class."""
|
"""Test the Scan class."""
|
||||||
|
|||||||
Reference in New Issue
Block a user