Updated annotations adapter factory
authorThierry Florac <thierry.florac@onf.fr>
Wed, 13 Jun 2018 11:25:38 +0200
changeset 193 59bd282a06f8
parent 192 011fc253137d
child 194 9313b3c435eb
child 264 6a4a802b91a3
Updated annotations adapter factory
src/pyams_utils/adapter.py
--- a/src/pyams_utils/adapter.py	Wed Jun 13 11:24:18 2018 +0200
+++ b/src/pyams_utils/adapter.py	Wed Jun 13 11:25:38 2018 +0200
@@ -159,6 +159,8 @@
         else:
             adapter = annotations[key] = factory()
             if markers:
+                if not isinstance(markers, (list, tuple, set)):
+                    markers = {markers}
                 for marker in markers:
                     alsoProvides(adapter, marker)
             if notify: