From e67db95e11d956f20e6d0635a15414c0b8c10e6e Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Fri, 14 Sep 2018 22:55:28 +0200 Subject: [PATCH] Migrate to py3 --- setup.py | 3 ++- seurvalencia/__init__.py | 6 +++--- seurvalencia/api.py | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 54f65a4..45d5f64 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,8 @@ setup(name='seurvalencia', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Affero General Public License v3', 'Operating System :: OS Independent', - 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules', ], diff --git a/seurvalencia/__init__.py b/seurvalencia/__init__.py index 6471a30..4acefe4 100644 --- a/seurvalencia/__init__.py +++ b/seurvalencia/__init__.py @@ -1,12 +1,12 @@ #This file is part of seurvalencia. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. -__version__ = '0.0.3' +__version__ = '0.0.4' __all__ = [ 'API', 'Picking', ] -from api import API -from picking import Picking +from .api import API +from .picking import Picking diff --git a/seurvalencia/api.py b/seurvalencia/api.py index 80230b2..ce2a5da 100644 --- a/seurvalencia/api.py +++ b/seurvalencia/api.py @@ -2,7 +2,7 @@ #this repository contains the full copyright notices and license terms. from seurvalencia.utils import seurvalencia_url from xml.dom.minidom import parseString -import urllib2 +from urllib import request import socket import os import genshi.template @@ -66,9 +66,9 @@ class API(object): 'Content-Type': 'text/xml; charset=utf-8', 'Content-Length': len(xml), } - request = urllib2.Request(self.url, xml, headers) + rqst = request.Request(self.url, xml, headers) try: - response = urllib2.urlopen(request) + response = request.urlopen(rqst) return response.read() except socket.timeout as err: return