Commit db5159a3 authored by Stefan Behnel's avatar Stefan Behnel

divert cythonrun output to stderr

parent d9d5ebb9
...@@ -29,19 +29,25 @@ LIBS = sysconfig.get_config_var('LIBS') ...@@ -29,19 +29,25 @@ LIBS = sysconfig.get_config_var('LIBS')
SYSLIBS = sysconfig.get_config_var('SYSLIBS') SYSLIBS = sysconfig.get_config_var('SYSLIBS')
if DEBUG: if DEBUG:
print('INCDIR: %s' % INCDIR) def _debug(msg, *args):
print('LIBDIR1: %s' % LIBDIR1) if args:
print('LIBDIR2: %s' % LIBDIR2) msg = msg % args
print('PYLIB: %s' % PYLIB) sys.stderr.write(msg + '\n')
else:
def _debug(*args):
pass
_debug('INCDIR: %s', INCDIR)
_debug('LIBDIR1: %s', LIBDIR1)
_debug('LIBDIR2: %s', LIBDIR2)
_debug('PYLIB: %s', PYLIB)
def runcmd(cmd, shell=True): def runcmd(cmd, shell=True):
if shell: if shell:
cmd = ' '.join(cmd) cmd = ' '.join(cmd)
if DEBUG: _debug(cmd)
print(cmd)
else: else:
if DEBUG: _debug(' '.join(cmd))
print(' '.join(cmd))
returncode = subprocess.call(cmd, shell=shell) returncode = subprocess.call(cmd, shell=shell)
if returncode: if returncode:
...@@ -57,8 +63,7 @@ def ccompile(basename): ...@@ -57,8 +63,7 @@ def ccompile(basename):
def cycompile(input_file, options=()): def cycompile(input_file, options=()):
from Cython.Compiler import Version, CmdLine, Main from Cython.Compiler import Version, CmdLine, Main
options, sources = CmdLine.parse_command_line(list(options or ()) + ['--embed', input_file]) options, sources = CmdLine.parse_command_line(list(options or ()) + ['--embed', input_file])
if DEBUG: _debug('Using Cython %s to compile %s', Version.version, input_file)
print('Using Cython %s to compile %s' % (Version.version, input_file))
result = Main.compile(sources, options) result = Main.compile(sources, options)
if result.num_errors > 0: if result.num_errors > 0:
sys.exit(1) sys.exit(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment