projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
11308: Fix bytes vs. str problems.
[arvados.git]
/
sdk
/
python
/
arvados
/
cache.py
diff --git
a/sdk/python/arvados/cache.py
b/sdk/python/arvados/cache.py
index 08c19e4aa7de1423bf80122fe437a732980380d8..868b478ac5112bdfd9e290d8ffba900f40980b79 100644
(file)
--- a/
sdk/python/arvados/cache.py
+++ b/
sdk/python/arvados/cache.py
@@
-1,5
+1,6
@@
+from builtins import object
import errno
import errno
-import
md5
+import
hashlib
import os
import tempfile
import time
import os
import tempfile
import time
@@
-32,14
+33,14
@@
class SafeHTTPCache(object):
return self._dir
def _filename(self, url):
return self._dir
def _filename(self, url):
- return os.path.join(self._dir,
md5.new
(url).hexdigest()+'.tmp')
+ return os.path.join(self._dir,
hashlib.md5
(url).hexdigest()+'.tmp')
def get(self, url):
filename = self._filename(url)
try:
with open(filename, 'rb') as f:
return f.read()
def get(self, url):
filename = self._filename(url)
try:
with open(filename, 'rb') as f:
return f.read()
- except IOError
,
OSError:
+ except IOError
as
OSError:
return None
def set(self, url, content):
return None
def set(self, url, content):