mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merged in mitya57/sphinx (pull request #176)
Make sure setup_command test can always import Sphinx
This commit is contained in:
commit
8e507f54a5
@ -14,6 +14,7 @@ import sys
|
|||||||
import subprocess
|
import subprocess
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import sphinx
|
||||||
|
|
||||||
from util import with_tempdir, test_roots, SkipTest
|
from util import with_tempdir, test_roots, SkipTest
|
||||||
from path import path
|
from path import path
|
||||||
@ -35,11 +36,15 @@ def with_setup_command(root, *args, **kwds):
|
|||||||
root.copytree(pkgrootdir)
|
root.copytree(pkgrootdir)
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
os.chdir(pkgrootdir)
|
os.chdir(pkgrootdir)
|
||||||
|
pythonpath = os.path.dirname(os.path.dirname(sphinx.__file__))
|
||||||
|
if os.getenv('PYTHONPATH'):
|
||||||
|
pythonpath = os.getenv('PYTHONPATH') + os.pathsep + pythonpath
|
||||||
command = [sys.executable, 'setup.py', 'build_sphinx']
|
command = [sys.executable, 'setup.py', 'build_sphinx']
|
||||||
command.extend(args)
|
command.extend(args)
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
command,
|
command,
|
||||||
|
env=dict(os.environ, PYTHONPATH=pythonpath),
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
func(pkgrootdir, proc, *args, **kwds)
|
func(pkgrootdir, proc, *args, **kwds)
|
||||||
|
Loading…
Reference in New Issue
Block a user