Ignore directories that are not packages in getpackage in util.py. Directories that end with .py but are not Python packages should not be parsed as if they are modules. Fixes #526