diff options
| author | Paweł Jastrzębski <[email protected]> | 2016-01-03 19:04:55 +0100 |
|---|---|---|
| committer | Paweł Jastrzębski <[email protected]> | 2016-01-03 19:04:55 +0100 |
| commit | 9015614b1a2ed873bf90ba19a4b53809b920c4a5 (patch) | |
| tree | e0381ecef989be70ec8c18c4e793358ce7e1deaf | |
| parent | LICENSE update (diff) | |
| download | kcc-9015614b1a2ed873bf90ba19a4b53809b920c4a5.tar.gz kcc-9015614b1a2ed873bf90ba19a4b53809b920c4a5.tar.bz2 kcc-9015614b1a2ed873bf90ba19a4b53809b920c4a5.zip | |
Error handling tweaks
| -rwxr-xr-x | kcc/comic2ebook.py | 2 | ||||
| -rw-r--r-- | kcc/shared.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/kcc/comic2ebook.py b/kcc/comic2ebook.py index 7bd1e9d..cd7ec82 100755 --- a/kcc/comic2ebook.py +++ b/kcc/comic2ebook.py @@ -556,7 +556,7 @@ def imgFileProcessing(work): output.append(img.saveToDir()) return output except Exception: - return str(sys.exc_info()[1]) + return str(sys.exc_info()[:2]) def getWorkFolder(afile): diff --git a/kcc/shared.py b/kcc/shared.py index 9833475..72bc07a 100644 --- a/kcc/shared.py +++ b/kcc/shared.py @@ -97,7 +97,7 @@ def check7ZFile(filePath): def saferReplace(old, new): - for x in range(10): + for x in range(30): try: os.replace(old, new) except PermissionError: @@ -109,7 +109,7 @@ def saferReplace(old, new): def saferRemove(target): - for x in range(10): + for x in range(30): try: os.remove(target) except PermissionError: @@ -129,11 +129,11 @@ def removeFromZIP(zipfname, *filenames): for item in zipread.infolist(): if item.filename not in filenames: zipwrite.writestr(item, zipread.read(item.filename)) - for x in range(50): + for x in range(30): try: copy(tempname, zipfname) except PermissionError: - sleep(0.1) + sleep(1) else: break else: |