Mercurial > public > mercurial-scm > hg
comparison mercurial/interfaces/util.py @ 52447:3c6809941280
interfaces: drop the conditional import of the vendored `zope` packages
The real `zope` code was only used when enabled by a test, and the decorators
turned into no-ops at runtime. Now that the test is disabled, unconditionally
use the no-op decorators and stop importing the code. This module can go away
once the `mercurial.interfaces.repository` interfaces are converted to Protocol
classes, but the vendored code can be deleted in the meantime.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 07 Dec 2024 03:11:02 -0500 |
parents | f4733654f144 |
children |
comparison
equal
deleted
inserted
replaced
52446:c1674551c109 | 52447:3c6809941280 |
---|---|
9 # bookkeeping for declaring interfaces. So, we use stubs for various | 9 # bookkeeping for declaring interfaces. So, we use stubs for various |
10 # zope.interface primitives unless instructed otherwise. | 10 # zope.interface primitives unless instructed otherwise. |
11 | 11 |
12 from __future__ import annotations | 12 from __future__ import annotations |
13 | 13 |
14 from .. import encoding | 14 if True: |
15 | |
16 if encoding.environ.get(b'HGREALINTERFACES'): | |
17 from ..thirdparty.zope import interface as zi | |
18 | |
19 Attribute = zi.Attribute | |
20 Interface = zi.Interface | |
21 implementer = zi.implementer | |
22 else: | |
23 | 15 |
24 class Attribute: | 16 class Attribute: |
25 def __init__(self, __name__, __doc__=b''): | 17 def __init__(self, __name__, __doc__=b''): |
26 pass | 18 pass |
27 | 19 |