Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 43103:c95b2f40db7c
py3: stop normalizing 2nd argument of *attr() to unicode
Now that we don't byteify strings, we can stop normalizing the 2nd
string argument to getattr() and remove explicit overrides we were
using in the code base.
We no longer use some helper functions in the source transformer,
so we remove those as well.
Differential Revision: https://phab.mercurial-scm.org/D7012
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 06 Oct 2019 17:45:05 -0400 |
parents | 1f339b503a40 |
children | d783f945a701 |
comparison
equal
deleted
inserted
replaced
43102:829088e87032 | 43103:c95b2f40db7c |
---|---|
621 """ | 621 """ |
622 | 622 |
623 def _fillbuffer(self): | 623 def _fillbuffer(self): |
624 res = super(observedbufferedinputpipe, self)._fillbuffer() | 624 res = super(observedbufferedinputpipe, self)._fillbuffer() |
625 | 625 |
626 fn = getattr(self._input._observer, r'osread', None) | 626 fn = getattr(self._input._observer, 'osread', None) |
627 if fn: | 627 if fn: |
628 fn(res, _chunksize) | 628 fn(res, _chunksize) |
629 | 629 |
630 return res | 630 return res |
631 | 631 |
632 # We use different observer methods because the operation isn't | 632 # We use different observer methods because the operation isn't |
633 # performed on the actual file object but on us. | 633 # performed on the actual file object but on us. |
634 def read(self, size): | 634 def read(self, size): |
635 res = super(observedbufferedinputpipe, self).read(size) | 635 res = super(observedbufferedinputpipe, self).read(size) |
636 | 636 |
637 fn = getattr(self._input._observer, r'bufferedread', None) | 637 fn = getattr(self._input._observer, 'bufferedread', None) |
638 if fn: | 638 if fn: |
639 fn(res, size) | 639 fn(res, size) |
640 | 640 |
641 return res | 641 return res |
642 | 642 |
643 def readline(self, *args, **kwargs): | 643 def readline(self, *args, **kwargs): |
644 res = super(observedbufferedinputpipe, self).readline(*args, **kwargs) | 644 res = super(observedbufferedinputpipe, self).readline(*args, **kwargs) |
645 | 645 |
646 fn = getattr(self._input._observer, r'bufferedreadline', None) | 646 fn = getattr(self._input._observer, 'bufferedreadline', None) |
647 if fn: | 647 if fn: |
648 fn(res) | 648 fn(res) |
649 | 649 |
650 return res | 650 return res |
651 | 651 |