]> git.0d.be Git - botaradio.git/commitdiff
Merge pull request #96 from Lartza/develop
authorTerry Geng <gengyanda@gmail.com>
Tue, 10 Mar 2020 14:57:19 +0000 (22:57 +0800)
committerGitHub <noreply@github.com>
Tue, 10 Mar 2020 14:57:19 +0000 (22:57 +0800)
Couple fixes

media/radio.py
util.py

index f2185e582fcda358038f42836402bf99b619041a..e825055601d16b37b7cdf44cbe1b423f5ca970f2 100644 (file)
@@ -80,10 +80,9 @@ def get_radio_title(url):
     except (requests.exceptions.ConnectionError,
             requests.exceptions.HTTPError,
             requests.exceptions.ReadTimeout,
-            requests.exceptions.Timeout) as e:
-        error_traceback = traceback.format_exc()
-        error = error_traceback.rstrip().split("\n")[-1]
-        log.debug("radio: unsuccessful attempts on fetching radio title (icy): " + error)
+            requests.exceptions.Timeout,
+            KeyError) as e:
+        log.debug("radio: unsuccessful attempts on fetching radio title (icy)")
     return url
 
 
diff --git a/util.py b/util.py
index 873813180fb4fd6f50ad2f6365aff9d599b87c6b..447b5c658bdb9f964fb3faaa148e5681159a62da 100644 (file)
--- a/util.py
+++ b/util.py
@@ -190,8 +190,8 @@ def pipe_no_wait(pipefd):
         import msvcrt
         import os
 
-        from ctypes import windll, byref, wintypes, GetLastError, WinError
-        from ctypes.wintypes import HANDLE, DWORD, POINTER, BOOL
+        from ctypes import windll, byref, wintypes, WinError, POINTER
+        from ctypes.wintypes import HANDLE, DWORD, BOOL
 
         LPDWORD = POINTER(DWORD)
         PIPE_NOWAIT = wintypes.DWORD(0x00000001)