Commit 6a6ffbe8 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Add support for python3.12

parent a15103a5
Pipeline #37088 passed with stage
in 0 seconds
......@@ -37,8 +37,16 @@ setup(
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
python_requires=">=2.7",
entry_points={
'console_scripts': [
'generate-signature-key = slapos.signature:run',
......
......@@ -28,14 +28,15 @@ import tempfile
import traceback
from base64 import b64encode, b64decode
try:
import configparser
from configparser import ConfigParser
from http.client import HTTPConnection, HTTPSConnection
from urllib.error import HTTPError
from urllib.parse import urlsplit
from urllib.request import urlopen
basestring = bytes, str
except ImportError:
import ConfigParser as configparser
from ConfigParser import SafeConfigParser as ConfigParser
ConfigParser.read_file = ConfigParser.readfp
from httplib import HTTPConnection, HTTPSConnection
from urllib2 import HTTPError, urlopen
from urlparse import urlsplit
......@@ -197,8 +198,8 @@ class NetworkcacheClient(object):
def __new_init(self, config, signature_certificate_list=None):
if not hasattr(config, 'get'):
parser = configparser.SafeConfigParser()
parser.readfp(config)
parser = ConfigParser()
parser.read_file(config)
config = dict(parser.items('networkcache'))
self.config = config
path = config.get('signature-private-key-file')
......
......@@ -16,10 +16,6 @@ import argparse
import os
import subprocess
import sys
try:
import configparser
except ImportError:
import ConfigParser as configparser
def generateCertificate(certificate_file, key_file, common_name):
if os.path.lexists(certificate_file):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment