Permalink
Browse files

Fix possible conflict by using a truly unique value.

Thanks to @chrisdickinson for pointing this out.  The other value was
not entirely unique, but creating a raw object allows for a unique ID
that can't conflict with other values where the string, however
unlikely, might.
  • Loading branch information...
1 parent 1042ed2 commit cd05edce4dc0bc19835e60b2fc4341ab588452d8 @tswicegood committed Jun 28, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 armstrong/utils/backends/base.py
View
4 armstrong/utils/backends/base.py
@@ -3,7 +3,7 @@
from django.utils.importlib import import_module
-DID_NOT_HANDLE = "Random return to signify inability to handle"
+DID_NOT_HANDLE = object()
class Proxy(object):
@@ -14,7 +14,7 @@ def __init__(self, possibles, attr):
def __call__(self, *args, **kwargs):
for possible in self.possibles:
ret = getattr(possible, self.attr, None)(*args, **kwargs)
- if ret == DID_NOT_HANDLE:
+ if ret is DID_NOT_HANDLE:
continue
return ret

0 comments on commit cd05edc

Please sign in to comment.