Fixed bug with acts missing __init__.py crashing uninstall
If the acts module does not have an __init__.py file in its root
directory then the __file__ attribute will not exist. The __path__
attribute will always exist and is safer to use.
Bug: 32755078
Test: Ran uninstaller to see that it still worked.
Change-Id: I392ec655265cca048d58b72808b05b991af4db14
diff --git a/acts/framework/setup.py b/acts/framework/setup.py
index 51fa13d..3ec3d9b 100755
--- a/acts/framework/setup.py
+++ b/acts/framework/setup.py
@@ -109,10 +109,9 @@
Args:
acts_module: The acts module to uninstall.
"""
- acts_install_dir = os.path.dirname(acts_module.__file__)
-
- self.announce('Deleting acts from: %s' % acts_install_dir, log.INFO)
- shutil.rmtree(acts_install_dir)
+ for acts_install_dir in acts_module.__path__:
+ self.announce('Deleting acts from: %s' % acts_install_dir, log.INFO)
+ shutil.rmtree(acts_install_dir)
def run(self):
"""Entry point for the uninstaller."""