This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients brett.cannon, eric.snow, ncoghlan, vstinner
Date 2016-03-16.23:05:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1458169551.37.0.0674390469083.issue26569@psf.upfronthosting.co.za>
In-reply-to
Content
Hmm. These two should be equivalent:

  if spec.loader.is_package(fullmodule):
      dict['__path__'] = [os.path.dirname(fname)]

  if spec.submodule_search_locations is not None:
      dict['__path__'] = spec.submodule_search_locations

Do you mean that "python -m pyclbr XXX" doesn't work for packages?  I'm guessing you mean something else because I was able to run it successfully for both "os" (sort of a package) and "importlib".

Also, I noticed that if I run pyclbr on the "test" package or "test.regrtest" I get back no output, not an error.  I'd expect to get output though.  Perhaps that's related?

If you are getting an error, what is the traceback you are getting?

Note that pyclbr fails with the following if you try to run it on a file or module that doesn't exist:

  AttributeError: 'NoneType' object has no attribute 'loader'
History
Date User Action Args
2016-03-16 23:05:51eric.snowsetrecipients: + eric.snow, brett.cannon, ncoghlan, vstinner
2016-03-16 23:05:51eric.snowsetmessageid: <1458169551.37.0.0674390469083.issue26569@psf.upfronthosting.co.za>
2016-03-16 23:05:51eric.snowlinkissue26569 messages
2016-03-16 23:05:51eric.snowcreate