properly use PackageInfo object. Avoid crash because distname ends up being None, closes #2509968 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 23 Oct 2012 09:19:08 +0200
branchstable
changeset 836 ed597f4c0f7e
parent 834 2b17abd6f7c9
child 847 ff4868ee734f
properly use PackageInfo object. Avoid crash because distname ends up being None, closes #2509968
_apycotlib/checkers/python.py
--- a/_apycotlib/checkers/python.py	Mon Jan 21 17:57:48 2013 +0100
+++ b/_apycotlib/checkers/python.py	Tue Oct 23 09:19:08 2012 +0200
@@ -55,9 +55,9 @@
     if not modname and exists(join(test.tmpdir, test.project_path(), '__pkginfo__.py')):
         from logilab.devtools.lib.pkginfo import PackageInfo
         pkginfo = PackageInfo(directory=test.project_path())
-        modname = getattr(pkginfo, 'modname', None)
-        distname = getattr(pkginfo, 'distname', modname)
-        package = getattr(pkginfo, 'subpackage_of', None)
+        modname = pkginfo.modname
+        distname = pkginfo.distname or modname
+        package = pkginfo.subpackage_of
         if modname and package:
             modname = '%s.%s' % (package, modname)
         elif distname.startswith('cubicweb-'):