New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backreferences processing breaks if module accessed without attribute #172

Closed
jnothman opened this Issue Nov 23, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@jnothman
Contributor

jnothman commented Nov 23, 2016

The scikit-learn docs fail to build at https://circleci.com/gh/scikit-learn/scikit-learn/7314?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link due to https://github.com/sphinx-gallery/sphinx-gallery/blob/master/sphinx_gallery/backreferences.py#L106 where it is assumed that a module being referenced is always referenced with an attribute. It should be possible to reference a module without its attribute and hence for no . to be present.

@lesteve

This comment has been minimized.

Contributor

lesteve commented Nov 23, 2016

Simple snippet reproducing the problem:

from sphinx_gallery.backreferences import identify_names

code_str = """
import os
hasattr(os, 'bla')
"""

identify_names(code_str)
@jnothman

This comment has been minimized.

Contributor

jnothman commented Nov 23, 2016

With apologies for not providing a snippet in the first place. I was being
a bad citizen.

On 23 November 2016 at 20:51, Loïc Estève notifications@github.com wrote:

Simple snippet reproducing the problem:

from sphinx_gallery.backreferences import identify_names

code_str = """import oshasattr(os, 'bla')"""

identify_names(code_str)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#172 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEz6yZWIylgEL88aSXfR81vpLDdy2CXks5rBAyxgaJpZM4K6M4k
.

@lesteve

This comment has been minimized.

Contributor

lesteve commented Nov 23, 2016

No worries, the issue was well explained so it took me five minutes tops to reproduce in a stand-alone snippet.

@Titan-C Titan-C closed this in #173 Nov 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment