Use str(e) instead of e.message to support Python 2 and 3

This commit is contained in:
mprahl
2019-09-11 12:38:02 -04:00
parent 00e78494d9
commit 6b484b7f49

View File

@@ -205,12 +205,12 @@ class SCM(object):
self.checkout_ref(self.commit)
except UnprocessableEntity as e:
if (
e.message.endswith(' did not match any file(s) known to git.\\n"')
or "fatal: reference is not a tree: " in e.message
str(e).endswith(' did not match any file(s) known to git.\\n"')
or "fatal: reference is not a tree: " in str(e)
):
raise UnprocessableEntity(
"checkout: The requested commit hash was not found within the repository. "
"Perhaps you forgot to push. The original message was: %s" % e.message
"Perhaps you forgot to push. The original message was: %s" % str(e)
)
raise