Skip to content

Commit

Permalink
Fix DeprecationWarning about IRegistered/IUnregistered
Browse files Browse the repository at this point in the history
This would show up as

    /path/to/site-packages/zope/configuration/config.py:240: DeprecationWarning: IRegistered is deprecated. Import from zope.interface.interfaces
      obj = getattr(mod, oname)
    /path/to/site-packages/zope/configuration/config.py:240: DeprecationWarning: IUnregistered is deprecated. Import from zope.interface.interfaces
      obj = getattr(mod, oname)

making it a bit difficult to discover where the source of the warnings
is.
  • Loading branch information
mgedmin committed Jul 10, 2019
1 parent 5fa9fbf commit 0b97d47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ CHANGES
4.0.1 (unreleased)
------------------

- Nothing changed yet.
- Fix deprecation warning about importing IRegistered/IUnregistered from
their old locations in zope.component.interfaces instead of their current
locations in zope.interface.interfaces.


4.0.0 (2017-05-25)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def read(*rnames):
'zope.container >= 4.1.0',
'zope.i18n >= 4.2.0, < 4.5.0',
'zope.i18nmessageid >= 4.1.0',
'zope.interface',
'zope.interface >= 3.8.0',
'zope.publisher >= 4.3.2',
'zope.security',
],
Expand Down
4 changes: 2 additions & 2 deletions src/zope/app/i18n/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@

<subscriber
for=".interfaces.ILocalTranslationDomain
zope.component.interfaces.IRegistered"
zope.interface.interfaces.IRegistered"
handler=".translationdomain.setDomainOnActivation"
/>

<subscriber
for=".interfaces.ILocalTranslationDomain
zope.component.interfaces.IUnregistered"
zope.interface.interfaces.IUnregistered"
handler=".translationdomain.unsetDomainOnDeactivation"
/>

Expand Down

0 comments on commit 0b97d47

Please sign in to comment.