Migrate to py3

This commit is contained in:
Raimon Esteve 2018-09-14 22:55:28 +02:00
parent aa4cc7df1d
commit e67db95e11
3 changed files with 8 additions and 7 deletions

View File

@ -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',
],

View File

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

View File

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