Skip to content

Instantly share code, notes, and snippets.

@anandnalya
Created August 6, 2013 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anandnalya/6162553 to your computer and use it in GitHub Desktop.
Save anandnalya/6162553 to your computer and use it in GitHub Desktop.
import shutil, errno
def copyanything(src, dst):
try:
shutil.copytree(src, dst)
except OSError as exc: # python >2.5
if exc.errno == errno.ENOTDIR:
shutil.copy(src, dst)
else: raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment