Skip to content

Commit

Permalink
Moar no need for 'try: ... except:' when we have 'six'.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Nov 15, 2014
1 parent 92beb55 commit 7706cd9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions gcloud/storage/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,7 @@ def new_key(self, key):
if isinstance(key, Key):
return key

# Support Python 2 and 3.
try:
string_type = six.string_types
except NameError: # pragma: NO COVER PY3k
string_type = str

if isinstance(key, string_type):
if isinstance(key, six.string_types):
return Key(bucket=self, name=key)

raise TypeError('Invalid key: %s' % key)
Expand Down

0 comments on commit 7706cd9

Please sign in to comment.