Author: Armin Rigo <ar...@tunes.org> Branch: msvcrt-cffi Changeset: r85741:44b1abd4fcbb Date: 2016-07-17 22:16 +0200 http://bitbucket.org/pypy/pypy/changeset/44b1abd4fcbb/
Log: fix for test_fileio diff --git a/lib_pypy/_subprocess.py b/lib_pypy/_subprocess.py --- a/lib_pypy/_subprocess.py +++ b/lib_pypy/_subprocess.py @@ -80,6 +80,14 @@ return _handle(target[0]) +def _z(input): + if input is None: + return _ffi.NULL + if isinstance(input, basestring): + return str(input) + raise TypeError("string/unicode/None expected, got %r" % ( + type(input).__name__,)) + def CreateProcess(name, command_line, process_attr, thread_attr, inherit, flags, env, start_dir, startup_info): si = _ffi.new("STARTUPINFO *") @@ -104,13 +112,9 @@ else: envbuf = _ffi.NULL - if name is None: name = _ffi.NULL - if command_line is None: command_line = _ffi.NULL - if start_dir is None: start_dir = _ffi.NULL - - res = _kernel32.CreateProcessA(name, command_line, _ffi.NULL, + res = _kernel32.CreateProcessA(_z(name), _z(command_line), _ffi.NULL, _ffi.NULL, inherit, flags, envbuf, - start_dir, si, pi) + _z(start_dir), si, pi) if not res: raise _WinError() _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit