diff options
author | Marc Hoersken <info@marc-hoersken.de> | 2020-01-29 17:14:01 +0100 |
---|---|---|
committer | Marc Hoersken <info@marc-hoersken.de> | 2020-02-27 18:05:43 +0100 |
commit | 8c7c4a6276fe26e8141a0949c5feac65272f7153 (patch) | |
tree | 27cc219d64a0fc58523a88848c65ffee0253a334 | |
parent | 02988b70cdd9f279d0024d1c4647b2e35ad40c52 (diff) |
tests: fix Python 3 compatibility of smbserver.py
-rw-r--r-- | tests/python_dependencies/impacket/smbserver.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/python_dependencies/impacket/smbserver.py b/tests/python_dependencies/impacket/smbserver.py index 3473c9f0c..c481b27ba 100644 --- a/tests/python_dependencies/impacket/smbserver.py +++ b/tests/python_dependencies/impacket/smbserver.py @@ -26,7 +26,10 @@ import socket import time import datetime import struct -import ConfigParser +try: # Python 3 + import configparser +except ImportError: # Python 2 + import ConfigParser as configparser import SocketServer import threading import logging @@ -4130,7 +4133,7 @@ smb.SMB.TRANS_TRANSACT_NMPIPE :self.__smbTransHandler.transactNamedPipe if self.__serverConfig is None: if configFile is None: configFile = 'smb.conf' - self.__serverConfig = ConfigParser.ConfigParser() + self.__serverConfig = configparser.ConfigParser() self.__serverConfig.read(configFile) self.__serverName = self.__serverConfig.get('global','server_name') |