py3: update Rust hgcommands code to pass argv to python as Str

Summary:
Update the Rust hgcommands code to pass the command line arguments into the
Python logic as `Str` types, so that this will be Unicode `str` objects when
using Python 3.

Reviewed By: xavierd

Differential Revision: D19596739

fbshipit-source-id: 7cdfd44a1c4ce8b0f86d20b634d9b27eab822b2d
This commit is contained in:
Adam Simpkins 2020-01-28 15:55:07 -08:00 committed by Facebook Github Bot
parent 2165181562
commit ad957e7803

View File

@ -92,7 +92,7 @@ impl HgPython {
None => fout.clone_ref(py),
Some(ref error) => write_to_py_object(py, error),
};
let args: Vec<Bytes> = args.into_iter().map(Bytes::from).collect();
let args: Vec<Str> = args.into_iter().map(Str::from).collect();
(args, fin, fout, ferr).to_py_object(py)
};
entry_point_mod.call(py, "run", call_args, None)?;