Skip to content

Commit

Permalink
For #28441: added raise_hell to _ensure_support()
Browse files Browse the repository at this point in the history
  • Loading branch information
nemoDreamer committed Mar 24, 2015
1 parent 9acca61 commit d7bf23d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions shotgun_api3/shotgun.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __init__(self, host, meta):
self.ensure_json_supported()


def _ensure_support(self, feature):
def _ensure_support(self, feature, raise_hell=True):
"""Checks the server version supports a given feature, raises an
exception if it does not.
Expand All @@ -147,10 +147,11 @@ def _ensure_support(self, feature):
"""

if not self.version or self.version < feature['version']:
raise ShotgunError(
"%s requires server version %s or higher, "\
"server is %s" % (feature['label'], _version_str(feature['version']), _version_str(self.version))
)
if raise_hell:
raise ShotgunError(
"%s requires server version %s or higher, "\
"server is %s" % (feature['label'], _version_str(feature['version']), _version_str(self.version))
)
return False
else:
return True
Expand Down

0 comments on commit d7bf23d

Please sign in to comment.