File tree Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 9
9
import base64
10
10
from hashlib import sha1
11
11
from iron_cache import *
12
+ import traceback as tb
12
13
13
14
key = 'KEY.%s.%s' % (os .environ .get ('TRAVIS_REPO_SLUG' ,'unk' ),
14
15
os .environ .get ('JOB_NAME' ,'unk' ))
16
+ print (key )
17
+
15
18
if sys .version_info [0 ] > 2 :
16
- key = sha1 ( bytes (key ,encoding = 'utf8' )). hexdigest ()[: 8 ] + '.'
17
- else :
18
- key = sha1 (key ).hexdigest ()[:8 ]+ '.'
19
+ key = bytes (key ,encoding = 'utf8' )
20
+
21
+ key = sha1 (key ).hexdigest ()[:8 ]+ '.'
19
22
20
23
b = b''
21
24
cache = IronCache ()
22
25
for i in range (20 ):
23
26
print ("getting %s" % key + str (i ))
24
27
try :
25
28
item = cache .get (cache = "travis" , key = key + str (i ))
26
- b += bytes (base64 .b64decode (item .value ))
27
- except :
29
+ v = item .value
30
+ if sys .version_info [0 ] > 2 :
31
+ v = bytes (v ,encoding = 'utf8' )
32
+ b += bytes (base64 .b64decode (v ))
33
+ except Exception as e :
34
+ try :
35
+ print (tb .format_exc (e ))
36
+ except :
37
+ print ("exception during exception, oh my" )
28
38
break
29
39
30
40
with open (os .path .join (os .environ .get ('HOME' ,'' ),"ccache.7z" ),'wb' ) as f :
Original file line number Diff line number Diff line change 12
12
13
13
key = 'KEY.%s.%s' % (os .environ .get ('TRAVIS_REPO_SLUG' ,'unk' ),
14
14
os .environ .get ('JOB_NAME' ,'unk' ))
15
+
16
+ key = 'KEY.%s.%s' % (os .environ .get ('TRAVIS_REPO_SLUG' ,'unk' ),
17
+ os .environ .get ('JOB_NAME' ,'unk' ))
18
+ print (key )
19
+
15
20
if sys .version_info [0 ] > 2 :
16
- key = sha1 ( bytes (key ,encoding = 'utf8' )). hexdigest ()[: 8 ] + '.'
17
- else :
18
- key = sha1 (key ).hexdigest ()[:8 ]+ '.'
21
+ key = bytes (key ,encoding = 'utf8' )
22
+
23
+ key = sha1 (key ).hexdigest ()[:8 ]+ '.'
19
24
20
25
os .chdir (os .environ .get ('HOME' ))
21
26
You can’t perform that action at this time.
0 commit comments