From 721de2ab18ba5689a8ccb77e9fd7ce927dcbc06c Mon Sep 17 00:00:00 2001 From: Freddie Vargus Date: Fri, 24 Mar 2017 17:30:33 -0400 Subject: [PATCH] ENH: Remove path.py as its not a dependency MAINT: Add try finally block to deal with exceptions --- docs/deploy.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/deploy.py b/docs/deploy.py index 74b60cb1..9120e033 100644 --- a/docs/deploy.py +++ b/docs/deploy.py @@ -2,7 +2,6 @@ from __future__ import print_function from contextlib import contextmanager from glob import glob -from path import path import os from os.path import abspath, basename, dirname, exists, isfile from shutil import move, rmtree @@ -32,8 +31,11 @@ def ensure_not_exists(path): def main(): + old_dir = os.getcwd() print("Moving to %s." % HERE) - with path(HERE): + os.chdir(HERE) + + try: print("Building docs with 'make html'") check_call(['make', 'html']) @@ -64,6 +66,8 @@ def main(): print("%s -> %s" % (file_, base)) ensure_not_exists(base) move(file_, '.') + finally: + os.chdir(old_dir) print() print("Updated documentation branch in directory %s" % ZIPLINE_ROOT)