##// END OF EJS Templates
If symlink already exists, clobber it with current one
Thomas Kluyver -
Show More
@@ -377,15 +377,11 b' class install_lib_symlink(Command):'
377 raise Exception("This doesn't work on Windows.")
377 raise Exception("This doesn't work on Windows.")
378 pkg = os.path.join(os.getcwd(), 'IPython')
378 pkg = os.path.join(os.getcwd(), 'IPython')
379 dest = os.path.join(self.install_dir, 'IPython')
379 dest = os.path.join(self.install_dir, 'IPython')
380 if os.path.islink(dest):
381 print('removing existing symlink at %s' % dest)
382 os.unlink(dest)
380 print('symlinking %s -> %s' % (pkg, dest))
383 print('symlinking %s -> %s' % (pkg, dest))
381 try:
384 os.symlink(pkg, dest)
382 os.symlink(pkg, dest)
383 except OSError as e:
384 if e.errno == errno.EEXIST and os.path.islink(dest) \
385 and os.path.realpath(dest) == pkg:
386 print('Symlink already exists')
387 else:
388 raise
389
385
390 class install_symlinked(install):
386 class install_symlinked(install):
391 def run(self):
387 def run(self):
General Comments 0
You need to be logged in to leave comments. Login now