From 22e0aae7ebb0963b1322af146c52830226941f60 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 7 Feb 2012 01:11:19 -0500 Subject: - Internal: catch unhashable discriminators early (raise an error instead of allowing them to find their way into resolveConflicts). --- CHANGES.txt | 3 +++ pyramid/config/__init__.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 9edcbdbe8..7d20796e1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,9 @@ Features - More informative error message when a ``config.include`` cannot find an ``includeme``. See https://github.com/Pylons/pyramid/pull/392. +- Internal: catch unhashable discriminators early (raise an error instead of + allowing them to find their way into resolveConflicts). + Bug Fixes --------- diff --git a/pyramid/config/__init__.py b/pyramid/config/__init__.py index 57ab7e13a..bd3a80ad3 100644 --- a/pyramid/config/__init__.py +++ b/pyramid/config/__init__.py @@ -533,6 +533,10 @@ class Configurator( ``extra`` provides a facility for inserting extra keys and values into an action dictionary. """ + # catch nonhashable discriminators here; most unit tests use + # autocommit=False, which won't catch unhashable discriminators + assert hash(discriminator) + if kw is None: kw = {} -- cgit v1.2.3