{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/5953","labels_url":"https://api.github.com/repos/numpy/numpy/issues/5953/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/5953/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/5953/events","html_url":"https://github.com/numpy/numpy/pull/5953","id":86357935,"number":5953,"title":"BF: do not crash lookfor if inspection fails - catch any Exception","user":{"login":"yarikoptic","id":39889,"avatar_url":"https://avatars.githubusercontent.com/u/39889?v=3","gravatar_id":"","url":"https://api.github.com/users/yarikoptic","html_url":"https://github.com/yarikoptic","followers_url":"https://api.github.com/users/yarikoptic/followers","following_url":"https://api.github.com/users/yarikoptic/following{/other_user}","gists_url":"https://api.github.com/users/yarikoptic/gists{/gist_id}","starred_url":"https://api.github.com/users/yarikoptic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarikoptic/subscriptions","organizations_url":"https://api.github.com/users/yarikoptic/orgs","repos_url":"https://api.github.com/users/yarikoptic/repos","events_url":"https://api.github.com/users/yarikoptic/events{/privacy}","received_events_url":"https://api.github.com/users/yarikoptic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-08T22:37:52Z","updated_at":"2015-06-09T05:17:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/5953","html_url":"https://github.com/numpy/numpy/pull/5953","diff_url":"https://github.com/numpy/numpy/pull/5953.diff","patch_url":"https://github.com/numpy/numpy/pull/5953.patch"},"body":"My use case:\r\n```\r\n$> PYTHONPATH=$PWD python -c \"import numpy as np, nipy; np.lookfor('whatever', nipy)\" \r\nTraceback (most recent call last):\r\n  File \"<string>\", line 1, in <module>\r\n  File \"numpy/lib/utils.py\", line 750, in lookfor\r\n    cache = _lookfor_generate_cache(module, import_modules, regenerate)\r\n  File \"numpy/lib/utils.py\", line 960, in _lookfor_generate_cache\r\n    for n, v in _getmembers(item):\r\n  File \"numpy/lib/utils.py\", line 978, in _getmembers\r\n    members = inspect.getmembers(item)\r\n  File \"/usr/lib/python2.7/inspect.py\", line 253, in getmembers\r\n    value = getattr(object, key)\r\n  File \"/usr/lib/python2.7/dist-packages/nipy/externals/six.py\", line 86, in __get__\r\n    result = self._resolve()\r\n  File \"/usr/lib/python2.7/dist-packages/nipy/externals/six.py\", line 105, in _resolve\r\n    return _import_module(self.mod)\r\n  File \"/usr/lib/python2.7/dist-packages/nipy/externals/six.py\", line 76, in _import_module\r\n    __import__(name)\r\nImportError: No module named _winreg\r\n```\r\nSo imho reverting back to rudimentary getattr should be the way to go for any exception to happen."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/110228007","html_url":"https://github.com/numpy/numpy/pull/5953#issuecomment-110228007","issue_url":"https://api.github.com/repos/numpy/numpy/issues/5953","id":110228007,"user":{"login":"rgommers","id":98330,"avatar_url":"https://avatars.githubusercontent.com/u/98330?v=3","gravatar_id":"","url":"https://api.github.com/users/rgommers","html_url":"https://github.com/rgommers","followers_url":"https://api.github.com/users/rgommers/followers","following_url":"https://api.github.com/users/rgommers/following{/other_user}","gists_url":"https://api.github.com/users/rgommers/gists{/gist_id}","starred_url":"https://api.github.com/users/rgommers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgommers/subscriptions","organizations_url":"https://api.github.com/users/rgommers/orgs","repos_url":"https://api.github.com/users/rgommers/repos","events_url":"https://api.github.com/users/rgommers/events{/privacy}","received_events_url":"https://api.github.com/users/rgommers/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T05:17:28Z","updated_at":"2015-06-09T05:17:28Z","body":"The ``lookfor`` cache generator is very greedy and tries to import everything it finds, including private modules that aren't necesarily meant for importing, so this change makes sense to me. "}}