mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-27 22:21:37 +08:00
ENH: Remove path.py as its not a dependency
MAINT: Add try finally block to deal with exceptions
This commit is contained in:
+6
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user