comparison contrib/debugcmdserver.py @ 43076:2372284d9457

formatting: blacken the codebase This is using my patch to black (https://github.com/psf/black/pull/826) so we don't un-wrap collection literals. Done with: hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions Differential Revision: https://phab.mercurial-scm.org/D6971
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:45:02 -0400
parents cd03fbd5ab57
children c102b704edb5
comparison
equal deleted inserted replaced
43075:57875cf423c9 43076:2372284d9457
21 if sys.argv[1] == '-': 21 if sys.argv[1] == '-':
22 log = sys.stderr 22 log = sys.stderr
23 else: 23 else:
24 log = open(sys.argv[1], 'a') 24 log = open(sys.argv[1], 'a')
25 25
26
26 def read(size): 27 def read(size):
27 data = sys.stdin.read(size) 28 data = sys.stdin.read(size)
28 if not data: 29 if not data:
29 raise EOFError 30 raise EOFError
30 sys.stdout.write(data) 31 sys.stdout.write(data)
31 sys.stdout.flush() 32 sys.stdout.flush()
32 return data 33 return data
34
33 35
34 try: 36 try:
35 while True: 37 while True:
36 header = read(outputfmtsize) 38 header = read(outputfmtsize)
37 channel, length = struct.unpack(outputfmt, header) 39 channel, length = struct.unpack(outputfmt, header)