Skip to content

Commit

Permalink
Fixed old imports to future/past and logger instance
Browse files Browse the repository at this point in the history
  • Loading branch information
npalacioescat committed Nov 13, 2024
1 parent 19ab74f commit 650b9c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pypath/share/curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# Website: https://pypath.omnipathdb.org/
#

from future.utils import iteritems
from past.builtins import xrange, range

import importlib as imp
import sys
Expand All @@ -30,7 +28,7 @@
import pypath.share.settings as settings
import pypath.share.session as session_mod
import pypath.share.cache as cache_mod
_logger = session_mod.log()
_logger = session_mod.logger

import pycurl
try:
Expand Down Expand Up @@ -490,7 +488,7 @@ def __init__(self,
header = True,
rownames = True):

for key, val in iteritems(locals()):
for key, val in locals().items():
setattr(self, key, val)
self.conf = fabric.config.Config()
env.keepalive = 60
Expand Down Expand Up @@ -1089,7 +1087,7 @@ def set_get(self):
urllib.quote_plus(param[0]),
urllib.quote_plus(param[1])
),
iteritems(self.get)
self.get.items()
)
)
)
Expand Down Expand Up @@ -1283,7 +1281,7 @@ def curl_call(self):

self._log('Setting up and calling pycurl.')

for attempt in xrange(self.retries):
for attempt in range(self.retries):

try:

Expand Down Expand Up @@ -1595,7 +1593,7 @@ def get_hash(self):
(
'?' + '&'.join(sorted([
i[0] + ' = ' + i[1]
for i in iteritems(self.post)
for i in self.post.items()
]))
)
)
Expand Down Expand Up @@ -1831,7 +1829,7 @@ def _decode_result(content):

if type(self.result) is dict:

for name, content in iteritems(self.result):
for name, content in self.result.items():

self.result[name] = _decode_result(content)

Expand Down
1 change: 1 addition & 0 deletions pypath/share/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

session = _ft.partial(_session, 'pypath')
log = _ft.partial(_log, 'pypath')
logger = session()._logger

0 comments on commit 650b9c9

Please sign in to comment.