From 3003aa2d473b2cd9cc0cc8130978e17bcb1fb293 Mon Sep 17 00:00:00 2001 From: Jeremy Smitherman Date: Tue, 3 Jul 2012 14:12:19 -0400 Subject: [PATCH] Added IndexError catch for copy module, IndexError is thrown if a destination file doesn't exist --- library/copy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/copy b/library/copy index 3d8c1f9e0f..f4c4a0f770 100755 --- a/library/copy +++ b/library/copy @@ -84,7 +84,11 @@ md5sum_src = None md5sum_src = md5_sum(src) md5sum_dest = None -md5sum_dest = md5_sum(dest) +try: + md5sum_dest = md5_sum(dest) +except IndexError: + # File doesn't exist yet, so clear to continue + pass if md5sum_src != md5sum_dest: os.system("cp %s %s" % (src, dest))