summaryrefslogtreecommitdiff
path: root/tests/python_dependencies
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2020-01-29 17:14:01 +0100
committerMarc Hoersken <info@marc-hoersken.de>2020-02-27 18:05:43 +0100
commit8c7c4a6276fe26e8141a0949c5feac65272f7153 (patch)
tree27cc219d64a0fc58523a88848c65ffee0253a334 /tests/python_dependencies
parent02988b70cdd9f279d0024d1c4647b2e35ad40c52 (diff)
downloadcurl-8c7c4a6276fe26e8141a0949c5feac65272f7153.tar.gz
tests: fix Python 3 compatibility of smbserver.py
Diffstat (limited to 'tests/python_dependencies')
-rw-r--r--tests/python_dependencies/impacket/smbserver.py7
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')