summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/py-protobuf/package.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-protobuf/package.py b/var/spack/repos/builtin/packages/py-protobuf/package.py
index 8730b265f7..c23029faa1 100644
--- a/var/spack/repos/builtin/packages/py-protobuf/package.py
+++ b/var/spack/repos/builtin/packages/py-protobuf/package.py
@@ -42,3 +42,11 @@ class PyProtobuf(PythonPackage):
def install_args(self, spec, prefix):
args = super(PyProtobuf, self).install_args(spec, prefix)
return args + ['--cpp_implementation']
+
+ @run_after('install')
+ def fix_import_error(self):
+ if str(self.spec['python'].version.up_to(1)) == '2':
+ touch = which('touch')
+ touch(self.prefix + '/' +
+ self.spec['python'].package.site_packages_dir +
+ '/google/__init__.py')