aboutsummaryrefslogtreecommitdiff
path: root/python/setup.py
diff options
context:
space:
mode:
authortemporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d>2008-09-15 17:58:05 +0000
committertemporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d>2008-09-15 17:58:05 +0000
commitbf86b546c3a395550278bf98e05821da604490b6 (patch)
tree7f8a8effa69be5cbc8e2dd188f5881b10d49a6dd /python/setup.py
parent742e40975aeba15cf596eefbabe26642ea74d83c (diff)
downloadprotobuf-bf86b546c3a395550278bf98e05821da604490b6.tar.gz
protobuf-bf86b546c3a395550278bf98e05821da604490b6.tar.bz2
protobuf-bf86b546c3a395550278bf98e05821da604490b6.zip
Add code suggested by Michal Januszewski <michalj@gmail.com> to ensure that
Python tests run correctly even when a previous version of the library is already installed. I was unable to reproduce his problem on my machine but the fix seems harmless enough.
Diffstat (limited to 'python/setup.py')
-rwxr-xr-xpython/setup.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/setup.py b/python/setup.py
index 638ee277..44d0f39b 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -47,6 +47,11 @@ def generate_proto(source):
sys.exit(-1)
def MakeTestSuite():
+ # This is apparently needed on some systems to make sure that the tests
+ # work even if a previous version is already installed.
+ if 'google' in sys.modules:
+ del sys.modules['google']
+
generate_proto("../src/google/protobuf/unittest.proto")
generate_proto("../src/google/protobuf/unittest_import.proto")
generate_proto("../src/google/protobuf/unittest_mset.proto")