Skip to content

Commit 3d057f0

Browse files
committed
Move main code in function to make variable locales instead of globals.
1 parent de9173a commit 3d057f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build_docs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def parse_args():
206206
return parser.parse_args()
207207

208208

209-
if __name__ == '__main__':
209+
def main():
210210
args = parse_args()
211211
if sys.stderr.isatty():
212212
logging.basicConfig(format="%(levelname)s:%(message)s",
@@ -233,3 +233,7 @@ def parse_args():
233233
sphinxbuild, args.skip_cache_invalidation)
234234
except Exception:
235235
logging.exception("docs build raised exception")
236+
237+
238+
if __name__ == '__main__':
239+
main()

0 commit comments

Comments
 (0)