aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2020-03-12 09:15:36 +0100
committerMarc Hoersken <info@marc-hoersken.de>2020-03-12 09:15:36 +0100
commitd5c01d779fc46fb25d68aa4cfadb0ef0905e2200 (patch)
treeb7a84f4f816e3488f9552646febf5e97de736040 /tests
parent467426963340b21ba0b604e9fb8ab87c32f86bf3 (diff)
smbserver: fix Python version specific ConfigParser import
Follow up to ee63837 and 8c7c4a6 Fixes #5077
Diffstat (limited to 'tests')
-rw-r--r--tests/python_dependencies/impacket/smbserver.py6
-rwxr-xr-xtests/smbserver.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/python_dependencies/impacket/smbserver.py b/tests/python_dependencies/impacket/smbserver.py
index c481b27ba..902d22f9c 100644
--- a/tests/python_dependencies/impacket/smbserver.py
+++ b/tests/python_dependencies/impacket/smbserver.py
@@ -26,9 +26,10 @@ import socket
import time
import datetime
import struct
-try: # Python 3
+import sys
+if sys.version_info.major >= 3:
import configparser
-except ImportError: # Python 2
+else:
import ConfigParser as configparser
import SocketServer
import threading
@@ -38,7 +39,6 @@ import ntpath
import os
import fnmatch
import errno
-import sys
import random
import shutil
from binascii import hexlify
diff --git a/tests/smbserver.py b/tests/smbserver.py
index 4fcd34f2b..fbebe1015 100755
--- a/tests/smbserver.py
+++ b/tests/smbserver.py
@@ -28,9 +28,9 @@ import os
import sys
import logging
import tempfile
-try: # Python 3
+if sys.version_info.major >= 3:
import configparser
-except ImportError: # Python 2
+else:
import ConfigParser as configparser
# Import our curl test data helper