Mercurial > hg
diff mercurial/sshpeer.py @ 37321:e826fe7a08c7
peer: make ui an attribute
With abc interfaces, instance attributes could not satisfy
@abc.abstractproperty requirements because interface conformance
was tested at type creation time. When we created the abc
peer interfaces, we had to make "ui" a @property to satisfy
abc.
Now that peer interfaces are using zope.interface and there is no
import time validation (but there are tests validating instances
conform to the interface), we can go back to using regular object
attributes.
Differential Revision: https://phab.mercurial-scm.org/D3069
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 30 Mar 2018 18:57:13 -0700 |
parents | 39f7d4ee8bcd |
children | afcfdf53e4b5 |
line wrap: on
line diff
--- a/mercurial/sshpeer.py Fri Mar 30 18:53:17 2018 -0700 +++ b/mercurial/sshpeer.py Fri Mar 30 18:57:13 2018 -0700 @@ -354,7 +354,7 @@ stderr and to forward its output. """ self._url = url - self._ui = ui + self.ui = ui # self._subprocess is unused. Keeping a handle on the process # holds a reference and prevents it from being garbage collected. self._subprocess = proc @@ -379,10 +379,6 @@ # Begin of ipeerconnection interface. - @util.propertycache - def ui(self): - return self._ui - def url(self): return self._url