Skip to content

Commit a8fb7cc

Browse files
author
Aina Rasoldier
committed
Correction of the Python installation, the importation were not correct (actually issue #282): simplification of the installation, work with Python 3 and shoud work with 2.7
1 parent 94e3d30 commit a8fb7cc

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

setup.py

+8-11
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,17 @@ def find_protoc():
7272
""" Generate Protobuf Messages """
7373

7474
def run(self):
75-
if sys.hexversion >= 0x3000000:
76-
pattern = re.compile('^import "osi_')
77-
for source in self.osi_files:
78-
with open(source) as src_file:
79-
with open(os.path.join(package_path, source),"w") as dst_file:
80-
for line in src_file:
81-
dst_file.write(pattern.sub('import "osi3/osi_',line))
75+
pattern = re.compile('^import "osi_')
76+
for source in self.osi_files:
77+
with open(source) as src_file:
78+
with open(os.path.join(package_path, source),"w") as dst_file:
79+
for line in src_file:
80+
dst_file.write(pattern.sub('import "' + package_name + '/osi_',line))
8281
for source in self.osi_files:
8382
sys.stdout.write('Protobuf-compiling ' + source + '\n')
84-
source_path = os.path.join(package_path, source) if sys.hexversion >= 0x3000000 else './' + source
83+
source_path = os.path.join(package_name, source)
8584
subprocess.check_call([self.find_protoc(),
86-
'--proto_path=' + package_path,
87-
'--proto_path=.',
88-
'--python_out=' + package_path,
85+
'--python_out=.',
8986
source_path])
9087

9188
build_py.run(self)

0 commit comments

Comments
 (0)