Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def check_project_id(project_id):
''' Python 2.x-compatible string typecheck. '''
if not project_id or not isinstance(project_id, basestring):
raise exceptions.InvalidProjectIdError(project_id)
else:
def check_project_id(project_id):
''' Python 3.x-compatible string typecheck. '''
if not project_id or not isinstance(project_id, str):
raise exceptions.InvalidProjectIdError(project_id)
def __init__(self, project_id):
super(InvalidProjectIdError, self).__init__(project_id)
self.project_id = project_id
self._message = "Invalid project id: {0}".format(project_id)