diff options
author | kafkaf- <thekafkaf@gmail.com> | 2014-11-14 16:05:00 +0200 |
---|---|---|
committer | kafkaf- <thekafkaf@gmail.com> | 2014-11-14 16:05:00 +0200 |
commit | ec26151db15c241e29c7730dc12657434370ff67 (patch) | |
tree | 7bd311cb3b7ec9a2b1459d63bdb580133bb23937 /jsonpointer.py | |
parent | 4dc82340e04f1f445e072952ec03a3e9f544bc66 (diff) | |
download | python-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.py | 5 |
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 |