Changeset 08d07ce for python/lib


Ignore:
Timestamp:
Jun 29, 2019, 1:14:08 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/timestretch, fix/ffmpeg5, master
Children:
3a83821
Parents:
9279ba0 (diff), 2244f00 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feature/timestretch

Location:
python/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_code.py

    r9279ba0 r08d07ce  
    524524      PyObject *type, *value, *traceback;
    525525      PyErr_Fetch(&type, &value, &traceback);
    526       PyErr_Restore(PyExc_ValueError, value, traceback);
     526      Py_XDECREF(type);
     527      type = PyExc_ValueError;
     528      Py_XINCREF(type);
     529      PyErr_Restore(type, value, traceback);
    527530    }}
    528531    return NULL;
  • python/lib/gen_external.py

    r9279ba0 r08d07ce  
    122122    proc = subprocess.Popen(cpp_cmd,
    123123                            stderr=subprocess.PIPE,
    124                             stdout=subprocess.PIPE)
     124                            stdout=subprocess.PIPE,
     125                            universal_newlines=True)
    125126    assert proc, 'Proc was none'
    126127    cpp_output = proc.stdout.read()
     
    128129    if err_output:
    129130        print("Warning: preprocessor produced errors or warnings:\n%s" \
    130                 % err_output.decode('utf8'))
     131                % err_output)
    131132    if not cpp_output:
    132133        raise_msg = "preprocessor output is empty! Running command " \
    133134                + "\"%s\" failed" % " ".join(cpp_cmd)
    134135        if err_output:
    135             raise_msg += " with stderr: \"%s\"" % err_output.decode('utf8')
     136            raise_msg += " with stderr: \"%s\"" % err_output
    136137        else:
    137138            raise_msg += " with no stdout or stderr"
    138139        raise Exception(raise_msg)
    139140    if not isinstance(cpp_output, list):
    140         cpp_output = [l.strip() for l in cpp_output.decode('utf8').split('\n')]
     141        cpp_output = [l.strip() for l in cpp_output.split('\n')]
    141142
    142143    return cpp_output
Note: See TracChangeset for help on using the changeset viewer.