aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSourabh Jain <sourabhjain@linux.ibm.com>2018-10-26 17:38:12 +0530
committerBryn M. Reeves <bmr@redhat.com>2019-03-18 20:02:58 +0000
commit2cfc2d7726691de523efd8a7dea04affbbab2480 (patch)
tree9df19037588a58875951190474f704a7b99fa6a1
parent42205ddf2f84ad27fecaf5e5f0a66cd445eb0400 (diff)
downloadsos-2cfc2d7726691de523efd8a7dea04affbbab2480.tar.gz
[utilities] Remove the __path__ attribute comparison with empty string
This patch removes an unnecessary comparison on package's __path__ attribute with an empty string in get_modules method. When we pass an empty path to _find_plugins_from_list function it returns None. The NoneType is not an iterable entity, so this will leads to runtime error when we extend the plugins list with None value. Resolves: #1463 Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/utilities.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/utilities.py b/sos/utilities.py
index 353a5a0f..6ab4e18d 100644
--- a/sos/utilities.py
+++ b/sos/utilities.py
@@ -285,7 +285,7 @@ class ImporterHelper(object):
package. """
plugins = []
for path in self.package.__path__:
- if os.path.isdir(path) or path == '':
+ if os.path.isdir(path):
plugins.extend(self._find_plugins_in_dir(path))
return plugins