summaryrefslogtreecommitdiff
path: root/jsonpointer.py
diff options
context:
space:
mode:
authorkafkaf- <thekafkaf@gmail.com>2014-11-14 16:05:00 +0200
committerkafkaf- <thekafkaf@gmail.com>2014-11-14 16:05:00 +0200
commitec26151db15c241e29c7730dc12657434370ff67 (patch)
tree7bd311cb3b7ec9a2b1459d63bdb580133bb23937 /jsonpointer.py
parent4dc82340e04f1f445e072952ec03a3e9f544bc66 (diff)
downloadpython-json-pointer-ec26151db15c241e29c7730dc12657434370ff67.tar.gz
Removed unrelated changes to the contains method, reverted the exception handle
Diffstat (limited to 'jsonpointer.py')
-rw-r--r--jsonpointer.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/jsonpointer.py b/jsonpointer.py
index 02aa594..b3f0362 100644
--- a/jsonpointer.py
+++ b/jsonpointer.py
@@ -166,8 +166,7 @@ class JsonPointer(object):
try:
doc = self.walk(doc, part)
- # Catching a broad exception to ensure the return of the default
- except:
+ except JsonPointerException:
if default is _nothing:
raise
else:
@@ -250,7 +249,7 @@ class JsonPointer(object):
def contains(self, ptr):
""" Returns True if self contains the given ptr """
- return len(self.parts) >= len(ptr.parts) and \
+ return len(self.parts) > len(ptr.parts) and \
self.parts[:len(ptr.parts)] == ptr.parts
@property