From bf86b546c3a395550278bf98e05821da604490b6 Mon Sep 17 00:00:00 2001 From: temporal Date: Mon, 15 Sep 2008 17:58:05 +0000 Subject: Add code suggested by Michal Januszewski 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. --- python/setup.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/setup.py') 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") -- cgit v1.2.3