Index: ensure_dependencies.py |
=================================================================== |
--- a/ensure_dependencies.py |
+++ b/ensure_dependencies.py |
@@ -350,16 +350,17 @@ def resolve_deps(repodir, level=0, self_ |
logging.info('Restarting %s' % target) |
os.execv(sys.executable, [sys.executable, target] + sys.argv[1:]) |
else: |
logging.warning('Cannot restart %s automatically, please rerun' % target) |
def _ensure_line_exists(path, pattern): |
with open(path, 'a+') as f: |
+ f.seek(0, os.SEEK_SET) |
file_content = [l.strip() for l in f.readlines()] |
if not pattern in file_content: |
file_content.append(pattern) |
f.seek(0, os.SEEK_SET) |
f.truncate() |
for l in file_content: |
print >>f, l |