Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/tools/publish_toolstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,12 @@ def update_latest(
return message


def main():
# Warning: Do not try to add a function containing the body of this try block.
# There are variables declared within that are implicitly global; it is unknown
# which ones precisely but at least this is true for `github_token`.
try:
if __name__ != '__main__':
exit(0)
repo = os.environ.get('TOOLSTATE_VALIDATE_MAINTAINERS_REPO')
if repo:
github_token = os.environ.get('TOOLSTATE_REPO_ACCESS_TOKEN')
Expand Down Expand Up @@ -342,11 +347,6 @@ def main():
}
))
response.read()


if __name__ == '__main__':
try:
main()
except urllib2.HTTPError as e:
print("HTTPError: %s\n%s" % (e, e.read()))
raise
except urllib2.HTTPError as e:
print("HTTPError: %s\n%s" % (e, e.read()))
raise