ENH: Remove path.py as its not a dependency

MAINT: Add try finally block to deal with exceptions
This commit is contained in:
Freddie Vargus
2017-03-24 17:30:33 -04:00
parent 43d6004cff
commit 721de2ab18
+6 -2
View File
@@ -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)