From 1bd4b72bf946c1f5327232de20ec68ba1369daeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Sun, 24 Nov 2019 23:32:50 +0100 Subject: Stop using string module, which has been deprecated. --- contrib/isaac.httpslib.py | 2 +- setup.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/isaac.httpslib.py b/contrib/isaac.httpslib.py index c5474b8..ec0a8ce 100644 --- a/contrib/isaac.httpslib.py +++ b/contrib/isaac.httpslib.py @@ -140,7 +140,7 @@ class HTTPProxyConnection(HTTPConnection): # Authenticated proxy import base64 userpass = "%s:%s" % (self.__username, self.__password) - enc_userpass = string.strip(base64.encodestring(userpass)) + enc_userpass = base64.encodestring(userpass).strip() self.putheader("Proxy-Authorization", "Basic %s" % enc_userpass) class HTTPSProxyResponse(HTTPResponse): diff --git a/setup.py b/setup.py index 35cfc89..4acffff 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,6 @@ import platform import re import shlex import shutil -import string import subprocess import sys @@ -344,7 +343,9 @@ def __get_version(): # noqa with open('M2Crypto/__init__.py') as init_file: for line in init_file: if line.startswith('__version__ ='): - return line.split('=')[1].strip(string.whitespace + "'") + # Originally string.whitespace, but it is deprecated + string_whitespace = ' \t\n\r\x0b\x0c' + return line.split('=')[1].strip(string_whitespace + "'") long_description_text = '''\ -- cgit v1.2.1