8000 Enable __future__ statements in sphinxext plot_directive (Trac #1653) · Issue #2249 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Enable __future__ statements in sphinxext plot_directive (Trac #1653) #2249
Closed
@numpy-gitbot

Description

@numpy-gitbot

Original ticket http://projects.scipy.org/numpy/ticket/1653 on 2010-10-29 by @mforbes, assigned to @pv.

Including statements like "from future import division" in the plot_pre_code fails because these are module specific.

One could fix this by changing line 464 of plot_directive.py to something like:

            futures = [l for l in setup.config.plot_pre_code
                       if "from __future__ import" in l]
            exec "\n".join(futures + [code]) in ns

This could probably be made slightly more robust. There may be another way of doing this, but I cannot see how right now.

Michael.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0