Mercurial > public > mercurial-scm > hg
diff mercurial/utils/procutil.py @ 45942:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | b56feaa9b520 |
children | 2cf61e66c6d0 |
line wrap: on
line diff
--- a/mercurial/utils/procutil.py Fri Nov 27 17:00:00 2020 -0500 +++ b/mercurial/utils/procutil.py Fri Nov 27 17:03:29 2020 -0500 @@ -292,10 +292,10 @@ def tempfilter(s, cmd): - '''filter string S through a pair of temporary files with CMD. + """filter string S through a pair of temporary files with CMD. CMD is used as a template to create the real command to be run, with the strings INFILE and OUTFILE replaced by the real names of - the temporary files generated.''' + the temporary files generated.""" inname, outname = None, None try: infd, inname = pycompat.mkstemp(prefix=b'hg-filter-in-') @@ -465,17 +465,16 @@ def tonativeenv(env): - '''convert the environment from bytes to strings suitable for Popen(), etc. - ''' + """convert the environment from bytes to strings suitable for Popen(), etc.""" return pycompat.rapply(tonativestr, env) def system(cmd, environ=None, cwd=None, out=None): - '''enhanced shell command execution. + """enhanced shell command execution. run with environment maybe modified, maybe in different dir. if out is specified, it is assumed to be a file-like object that has a - write() method. stdout and stderr will be redirected to out.''' + write() method. stdout and stderr will be redirected to out.""" try: stdout.flush() except Exception: @@ -685,14 +684,14 @@ record_wait=None, stdin_bytes=None, ): - '''Spawn a command without waiting for it to finish. + """Spawn a command without waiting for it to finish. When `record_wait` is not None, the spawned process will not be fully detached and the `record_wait` argument will be called with a the `Subprocess.wait` function for the spawned process. This is mostly useful for developers that need to make sure the spawned process - finished before a certain point. (eg: writing test)''' + finished before a certain point. (eg: writing test)""" if pycompat.isdarwin: # avoid crash in CoreFoundation in case another thread # calls gui() while we're calling fork().