summaryrefslogtreecommitdiff
path: root/astroid/modutils.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2016-08-24 11:08:05 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2016-08-24 11:08:05 +0300
commitf06b62a3e1bad9b0455dac83648677059227390c (patch)
tree7299798946ff5c17f09c41dedf71712528fedfb2 /astroid/modutils.py
parent39fdd0de8bca4264c7329aa3de947bbc99432a0d (diff)
downloadastroid-git-f06b62a3e1bad9b0455dac83648677059227390c.tar.gz
Export two helpers for verifying the type of a spec.
Diffstat (limited to 'astroid/modutils.py')
-rw-r--r--astroid/modutils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py
index d198be7c..a0f3318f 100644
--- a/astroid/modutils.py
+++ b/astroid/modutils.py
@@ -633,3 +633,10 @@ def _has_init(directory):
if os.path.exists(mod_or_pack + '.' + ext):
return mod_or_pack + '.' + ext
return None
+
+
+def is_namespace(specobj):
+ return specobj.type == spec.ModuleType.PY_NAMESPACE
+
+def is_directory(specobj):
+ return specobj.type == spec.ModuleType.PKG_DIRECTORY