From fa690a7e5fa4ff357217864909c531fc996d8ea4 Mon Sep 17 00:00:00 2001 From: Thibault Genessay Date: Tue, 1 Mar 2016 13:01:36 +0100 Subject: [PATCH] Added shell=True to Popen() on win32 This allows 'dot.exe' to be found when called with 'dot', as long as 'dot.exe' is in the PATH. --- sphinxtools/inheritance.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sphinxtools/inheritance.py b/sphinxtools/inheritance.py index b1dc5318..d2c970bf 100644 --- a/sphinxtools/inheritance.py +++ b/sphinxtools/inheritance.py @@ -269,9 +269,18 @@ class InheritanceDiagram(object): dot_args.extend(['-Tpng', '-o' + outfn]) dot_args.extend(['-Tcmapx', '-o' + mapfile]) + popen_args = { + 'stdout': PIPE, + 'stdin': PIPE, + 'stderr': PIPE + } + + if sys.platform == 'win32': + popen_args['shell'] = True + try: - p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE) + p = Popen(dot_args, **popen_args) except OSError as err: