Skip to content

Commit 65c5377

Browse files
committed
travising python 3 fails. II
1 parent 68d86d5 commit 65c5377

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

wllvm/compilers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ def outputFileCallback(self, flag, filename):
7373
self.outputFilename = filename
7474

7575

76+
def getHashedPathName(path):
77+
return hashlib.sha256(path).encode('utf-8').hexdigest() if path else None
78+
7679

7780
def attachBitcodePathToObject(bcPath, outFileName):
7881
# Don't try to attach a bitcode path to a binary. Unfortunately
@@ -110,7 +113,7 @@ def attachBitcodePathToObject(bcPath, outFileName):
110113
# file to that location, using a hash of the original bitcode path as a name
111114
storeEnv = os.getenv('WLLVM_BC_STORE')
112115
if storeEnv:
113-
hashName = hashlib.sha256(absBcPath).hexdigest()
116+
hashName = getHashedPathName(absBcPath)
114117
copyfile(absBcPath, os.path.join(storeEnv, hashName))
115118

116119
try:

wllvm/extraction.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from .compilers import elfSectionName
1717
from .compilers import darwinSegmentName
1818
from .compilers import darwinSectionName
19+
from .compilers import getHashedPathName
1920

2021
from .filetype import FileType
2122

@@ -153,7 +154,7 @@ def extract_section_linux(inputFile):
153154
def getStorePath(bcPath):
154155
storeEnv = os.getenv('WLLVM_BC_STORE')
155156
if storeEnv:
156-
hashName = hashlib.sha256(bcPath).hexdigest()
157+
hashName = getHashedPathName(bcPath)
157158
hashPath = os.path.join(storeEnv, hashName)
158159
if os.path.isfile(hashPath):
159160
return hashPath

0 commit comments

Comments
 (0)