diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2017-07-03 10:41:09 +0100 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2018-06-26 12:42:26 +0100 |
commit | 277576268c51431196a84ebd0789ad415cf4e58e (patch) | |
tree | 7c854cfa9212dd8b0501f20e63fe62afeec6cee8 /deluge/core/core.py | |
parent | 74aa0db95603b2396fe9a0f297e8d80a056be95e (diff) | |
download | deluge-277576268c51431196a84ebd0789ad415cf4e58e.tar.gz deluge-277576268c51431196a84ebd0789ad415cf4e58e.tar.bz2 deluge-277576268c51431196a84ebd0789ad415cf4e58e.zip |
[Py2to3] Replace deprecated base64.(de|en)codestring
* In Py3 base64.encodestring is deprecated so rather than use the
Py3 only encodebytes instead use b64encode. The other advantage is
that with issue a consistent TypeError is raised that we can catch.
Diffstat (limited to 'deluge/core/core.py')
-rw-r--r-- | deluge/core/core.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/deluge/core/core.py b/deluge/core/core.py index 4def9d727..00266fac2 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -390,7 +390,7 @@ class Core(component.Component): """ try: filedump = b64decode(filedump) - except Exception as ex: + except TypeError as ex: log.error('There was an error decoding the filedump string: %s', ex) try: @@ -958,7 +958,7 @@ class Core(component.Component): try: filedump = b64decode(filedump) - except Exception as ex: + except TypeError as ex: log.error('There was an error decoding the filedump string!') log.exception(ex) return |