Skip to content

Commit 478b68b

Browse files
scovettapiedar
andcommitted
Don't raise unless exception occurs.
This commit adds a check before `raise last_error`. `last_error` could still be `None`, in which case `raise None` itself throws an exception, which is probably not what you want. Co-authored-by: Benn Snyder <benn.snyder@gmail.com> Signed-off-by: Benn Snyder <benn.snyder@gmail.com> Reviewed-by: Benn Snyder <benn.snyder@gmail.com>
1 parent 8f5ba39 commit 478b68b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ include (SetupDirectories)
4747

4848
set (PROJECT_VER_MAJOR 0)
4949
set (PROJECT_VER_MINOR 6)
50-
set (PROJECT_VER_PATCH 4)
50+
set (PROJECT_VER_PATCH 5)
5151
set (PROJECT_VER
5252
"${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}")
5353
set (PROJECT_APIVER

src/fwfetcher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ def urlopen_timeout_retry(request, attempts = 5):
534534
except socket.timeout as e:
535535
print("Timeout! ", e)
536536
last_error = e
537-
raise last_error
537+
if last_error:
538+
raise last_error
538539

539540
def getFileOrURL(filename, url):
540541
# Check if a file named filename exists on disk.

0 commit comments

Comments
 (0)