Skip to content

Commit

Permalink
update code.
Browse files Browse the repository at this point in the history
  • Loading branch information
huiguangjun committed May 29, 2023
1 parent c09d31b commit 5f38341
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions oss2/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,8 @@ def object_exists(self, key, headers=None):
self.get_object_meta(key, headers=headers)
except exceptions.NoSuchKey:
return False
except exceptions.NoSuchBucket:
raise
except exceptions.NotFound:
return False
except:
Expand Down
2 changes: 1 addition & 1 deletion oss2/xml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def parse_list_buckets(result, body):
if result.is_truncated:
result.next_marker = _find_tag(root, 'NextMarker')

if root.find('Owner'):
if root.find('Owner') is not None:
result.owner = Owner(_find_tag_with_default(root, 'Owner/DisplayName', None), _find_tag_with_default(root, 'Owner/ID', None))

for bucket_node in root.findall('Buckets/Bucket'):
Expand Down

0 comments on commit 5f38341

Please sign in to comment.