Skip to content

Commit c0cf4c2

Browse files
committed
Merge pull request #21 from BenjaminSchubert/master
updated to support python3.3 and python3.4 in addition to python2.7
2 parents 2748c49 + 51fd8c4 commit c0cf4c2

File tree

2 files changed

+16
-27
lines changed

2 files changed

+16
-27
lines changed

driver/as

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
# (which was created in the first compilation phase by the real
1111
# compiler). We'll link this together at a later stage.
1212

13-
import os
14-
import sys
15-
from utils import *
13+
from __future__ import absolute_import
14+
15+
from .utils import *
1616
from subprocess import *
17-
from popenwrapper import Popen
18-
import logconfig
17+
from .popenwrapper import Popen
1918

2019

2120
class BCFilter(ArgumentListFilter):

driver/utils.py

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from __future__ import absolute_import
2+
from __future__ import print_function
3+
14
from subprocess import *
25
import collections
36
import pprint
@@ -7,26 +10,13 @@
710
import re
811
import sys
912
import tempfile
13+
from .popenwrapper import Popen
1014

1115
fullSelfPath = os.path.realpath(__file__)
1216
prefix = os.path.dirname(fullSelfPath)
1317
driverDir = prefix
1418

15-
# This is a bit hacky.
16-
# We cannot do
17-
# from .popenwrapper import Popen
18-
# OR
19-
# from driver.popenwrapper import Popen
20-
# because then 'as' will not succesfully import us (wllvm/wllvm++ can
21-
# successfully import however).
22-
#
23-
# Using
24-
# from popenwrapper import Popen
25-
# will allow 'as' to import us but then wllvm/wllvm++ will not be able to.
26-
#
27-
# The work around is to put this directory in the search path for modules.
28-
sys.path.insert(0,driverDir)
29-
from popenwrapper import Popen
19+
3020

3121
# Environmental variable for path to compiler tools (clang/llvm-link etc..)
3222
llvmCompilerPathEnv = 'LLVM_COMPILER_PATH'
@@ -391,15 +381,15 @@ def getArtifactNames(self, srcFile, hidden=False):
391381

392382
#iam: for printing our partitioning of the args
393383
def dump(self):
394-
print "compileArgs: ", self.compileArgs
395-
print "inputFiles: ", self.inputFiles
396-
print "linkArgs: ", self.linkArgs
397-
print "objectFiles: ", self.objectFiles
398-
print "outputFilename: ", self.outputFilename
384+
print("compileArgs: ", self.compileArgs)
385+
print("inputFiles: ", self.inputFiles)
386+
print("linkArgs: ", self.linkArgs)
387+
print("objectFiles: ", self.objectFiles)
388+
print("outputFilename: ", self.outputFilename)
399389
for srcFile in self.inputFiles:
400-
print "srcFile: ", srcFile
390+
print("srcFile: ", srcFile)
401391
(objFile, bcFile) = self.getArtifactNames(srcFile)
402-
print "{0} ===> ({1}, {2})".format(srcFile, objFile, bcFile)
392+
print("{0} ===> ({1}, {2})".format(srcFile, objFile, bcFile))
403393

404394

405395

0 commit comments

Comments
 (0)