tests: fix Python 3 compatibility of smbserver.py

This commit is contained in:
Marc Hoersken 2020-01-29 17:14:01 +01:00
parent 02988b70cd
commit 8c7c4a6276

View File

@ -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')