Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Forward compatibility for ``pyramid_zcml`` >= 0.8 + ``zope.configur…

…ation``

  >= 3.8.0.
  • Loading branch information...
commit 07cada3a517ec171a993f94ed228d423329a19a8 1 parent 50a794b
@mcdonc mcdonc authored
View
3  CHANGES.txt
@@ -10,6 +10,9 @@ Features
- Prevent a scaffold rendering from being named ``site`` (conflicts with
Python internal site.py).
+- Forward compatibility for ``pyramid_zcml`` >= 0.8 + ``zope.configuration``
+ >= 3.8.0.
+
Backward Incompatibilities
--------------------------
View
14 pyramid/config/__init__.py
@@ -969,8 +969,18 @@ def resolveConflicts(actions):
unique = {}
output = []
for i in range(len(actions)):
- (discriminator, callable, args, kw, includepath, info, order
- ) = expand_action(*(actions[i]))
+ action = actions[i]
+ if isinstance(action, dict): # z.config 3.8.0+
+ discriminator = action['discriminator']
+ callable = action['callable']
+ args = action['args']
+ kw = action['kw']
+ includepath = action['includepath']
+ info = action['info']
+ order = action['order']
+ else:
+ (discriminator, callable, args, kw, includepath, info, order
+ ) = expand_action(*(actions[i]))
order = order or i
if discriminator is None:
View
20 pyramid/tests/test_config/test_init.py
@@ -1477,6 +1477,26 @@ def test_it_conflict(self):
]
)
+ def test_it_with_zopeconfig_380_dict(self):
+ from pyramid.tests.test_config import dummyfactory as f
+ result = self._callFUT([
+ {'discriminator':None, 'callable':f, 'args':(), 'kw':{},
+ 'includepath':(), 'info':None, 'order':0},
+ (1, f, (1,), {}, (), 'first'),
+ (1, f, (2,), {}, ('x',), 'second'),
+ (1, f, (3,), {}, ('y',), 'third'),
+ (4, f, (4,), {}, ('y',), 'should be last', 99999),
+ (3, f, (3,), {}, ('y',)),
+ (None, f, (5,), {}, ('y',)),
+ ])
+ self.assertEqual(result,
+ [(None, f),
+ (1, f, (1,), {}, (), 'first'),
+ (3, f, (3,), {}, ('y',)),
+ (None, f, (5,), {}, ('y',)),
+ (4, f, (4,), {}, ('y',), 'should be last')])
+
+
class TestGlobalRegistriesIntegration(unittest.TestCase):
def setUp(self):
from pyramid.config import global_registries
Please sign in to comment.
Something went wrong with that request. Please try again.