# HG changeset patch # User Augie Fackler # Date 1520017790 18000 # Node ID 26a6b62919e225fd99e1ca5ed3cc9bd895f2e346 # Parent f5427483eebeaf1a6d7f82b5dbdc6507f70d5e89 util: work around Python 3 returning None at EOF instead of '' Differential Revision: https://phab.mercurial-scm.org/D2561 diff -r f5427483eebe -r 26a6b62919e2 mercurial/util.py --- a/mercurial/util.py Fri Mar 02 14:09:20 2018 -0500 +++ b/mercurial/util.py Fri Mar 02 14:09:50 2018 -0500 @@ -729,6 +729,9 @@ def read(self, res, size=-1): if not self.reads: return + # Python 3 can return None from reads at EOF instead of empty strings. + if res is None: + res = '' self.fh.write('%s> read(%d) -> %d' % (self.name, size, len(res))) self._writedata(res)