Skip to content

Commit

Permalink
[fc] Repository: plone.app.textfield
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2020-08-22T11:25:03+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.textfield@348a6cb

Fixed deprecation warning for zope.component.interfaces.ComponentLookupError

```
DeprecationWarning: ComponentLookupError is deprecated. Import from zope.interface.interfaces
```

And moved some imports out of the try/except ImportError which is only meant for IMarkupSchema.
With the original code, once the backwards compatibility import in zope.component is gone,
we would have gotten an ImportError for it, and the markup schema would not be available.

Files changed:
A news/43.bugfix
M plone/app/textfield/utils.py
Repository: plone.app.textfield

Branch: refs/heads/master
Date: 2020-08-24T12:30:21+02:00
Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl>
Commit: plone/plone.app.textfield@484005c

Merge pull request #43 from plone/maurits/fix-startup-warnings

Fixed deprecation warning for ComponentLookupError

Files changed:
A news/43.bugfix
M plone/app/textfield/utils.py
  • Loading branch information
mauritsvanrees committed Aug 24, 2020
1 parent 19cdcc4 commit 6b0d94c
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
Repository: plone.subrequest
Repository: plone.app.textfield


Branch: refs/heads/master
Date: 2020-08-22T11:16:22+02:00
Date: 2020-08-22T11:25:03+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: https://github.com/plone/plone.subrequest/commit/4ddab797fdafd090e7ac822f0c8e50b2bf85611d
Commit: https://github.com/plone/plone.app.textfield/commit/348a6cb8b5b93447b9145325d7092ac1f8254082

Fixed deprecation warning for zope.site.hooks.
Fixed deprecation warning for zope.component.interfaces.ComponentLookupError

```
DeprecationWarning: zope.site.hooks has moved to zope.component.hooks. Import of zope.site.hooks will become unsupported in Version 5.0
DeprecationWarning: ComponentLookupError is deprecated. Import from zope.interface.interfaces
```

And moved some imports out of the try/except ImportError which is only meant for IMarkupSchema.
With the original code, once the backwards compatibility import in zope.component is gone,
we would have gotten an ImportError for it, and the markup schema would not be available.

Files changed:
A news/24.bugfix
M plone/subrequest/__init__.py
A news/43.bugfix
M plone/app/textfield/utils.py

b'diff --git a/news/24.bugfix b/news/24.bugfix\nnew file mode 100644\nindex 0000000..8d46895\n--- /dev/null\n+++ b/news/24.bugfix\n@@ -0,0 +1,2 @@\n+Fixed deprecation warning for zope.site.hooks.\n+[maurits]\ndiff --git a/plone/subrequest/__init__.py b/plone/subrequest/__init__.py\nindex fbc5852..6071348 100644\n--- a/plone/subrequest/__init__.py\n+++ b/plone/subrequest/__init__.py\n@@ -12,11 +12,11 @@\n from six.moves.urllib.parse import urljoin\n from six.moves.urllib.parse import urlsplit\n from zope.component import queryMultiAdapter\n+from zope.component.hooks import getSite\n+from zope.component.hooks import setSite\n from zope.globalrequest import getRequest\n from zope.globalrequest import setRequest\n from zope.interface import alsoProvides\n-from zope.site.hooks import getSite\n-from zope.site.hooks import setSite\n from ZPublisher.BaseRequest import RequestContainer\n from ZPublisher.mapply import mapply\n \n'
b'diff --git a/news/43.bugfix b/news/43.bugfix\nnew file mode 100644\nindex 0000000..5a87e62\n--- /dev/null\n+++ b/news/43.bugfix\n@@ -0,0 +1,2 @@\n+Fixed deprecation warning for ``zope.component.interfaces.ComponentLookupError``.\n+[maurits]\ndiff --git a/plone/app/textfield/utils.py b/plone/app/textfield/utils.py\nindex 4c19ae1..8ce90d9 100644\n--- a/plone/app/textfield/utils.py\n+++ b/plone/app/textfield/utils.py\n@@ -1,13 +1,13 @@\n # -*- coding: utf-8 -*-\n+from plone.registry.interfaces import IRegistry\n from Products.CMFCore.utils import getToolByName\n+from zope.component import getUtility\n from zope.component.hooks import getSite\n+from zope.interface.interfaces import ComponentLookupError\n \n \n try:\n from Products.CMFPlone.interfaces import IMarkupSchema\n- from plone.registry.interfaces import IRegistry\n- from zope.component import getUtility\n- from zope.component.interfaces import ComponentLookupError\n except ImportError:\n IMarkupSchema = None\n \n'

Repository: plone.subrequest
Repository: plone.app.textfield


Branch: refs/heads/master
Date: 2020-08-24T11:15:20+02:00
Date: 2020-08-24T12:30:21+02:00
Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl>
Commit: https://github.com/plone/plone.subrequest/commit/392aecf1de57ed476338ad315c9a9537859c5696
Commit: https://github.com/plone/plone.app.textfield/commit/484005ceeae61e3e0caa69186a3f3d4a80e16cd5

Merge pull request #24 from plone/maurits/fix-startup-warnings
Merge pull request #43 from plone/maurits/fix-startup-warnings

Fixed deprecation warning for zope.site.hooks
Fixed deprecation warning for ComponentLookupError

Files changed:
A news/24.bugfix
M plone/subrequest/__init__.py
A news/43.bugfix
M plone/app/textfield/utils.py

b'diff --git a/news/24.bugfix b/news/24.bugfix\nnew file mode 100644\nindex 0000000..8d46895\n--- /dev/null\n+++ b/news/24.bugfix\n@@ -0,0 +1,2 @@\n+Fixed deprecation warning for zope.site.hooks.\n+[maurits]\ndiff --git a/plone/subrequest/__init__.py b/plone/subrequest/__init__.py\nindex fbc5852..6071348 100644\n--- a/plone/subrequest/__init__.py\n+++ b/plone/subrequest/__init__.py\n@@ -12,11 +12,11 @@\n from six.moves.urllib.parse import urljoin\n from six.moves.urllib.parse import urlsplit\n from zope.component import queryMultiAdapter\n+from zope.component.hooks import getSite\n+from zope.component.hooks import setSite\n from zope.globalrequest import getRequest\n from zope.globalrequest import setRequest\n from zope.interface import alsoProvides\n-from zope.site.hooks import getSite\n-from zope.site.hooks import setSite\n from ZPublisher.BaseRequest import RequestContainer\n from ZPublisher.mapply import mapply\n \n'
b'diff --git a/news/43.bugfix b/news/43.bugfix\nnew file mode 100644\nindex 0000000..5a87e62\n--- /dev/null\n+++ b/news/43.bugfix\n@@ -0,0 +1,2 @@\n+Fixed deprecation warning for ``zope.component.interfaces.ComponentLookupError``.\n+[maurits]\ndiff --git a/plone/app/textfield/utils.py b/plone/app/textfield/utils.py\nindex 4c19ae1..8ce90d9 100644\n--- a/plone/app/textfield/utils.py\n+++ b/plone/app/textfield/utils.py\n@@ -1,13 +1,13 @@\n # -*- coding: utf-8 -*-\n+from plone.registry.interfaces import IRegistry\n from Products.CMFCore.utils import getToolByName\n+from zope.component import getUtility\n from zope.component.hooks import getSite\n+from zope.interface.interfaces import ComponentLookupError\n \n \n try:\n from Products.CMFPlone.interfaces import IMarkupSchema\n- from plone.registry.interfaces import IRegistry\n- from zope.component import getUtility\n- from zope.component.interfaces import ComponentLookupError\n except ImportError:\n IMarkupSchema = None\n \n'

0 comments on commit 6b0d94c

Please sign in to comment.