aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel <[email protected]>2018-02-06 11:19:42 -0500
committerGitHub <[email protected]>2018-02-06 11:19:42 -0500
commitd53c3a6c12f640519c5e4d569421a35c43978ef5 (patch)
treee9e561da353630071fdf08cc7edfb5759955a158
parentAdd errcheck functions to opus foreign functions (diff)
downloaddiscord.py-d53c3a6c12f640519c5e4d569421a35c43978ef5.tar.xz
discord.py-d53c3a6c12f640519c5e4d569421a35c43978ef5.zip
Fixed opus error check
Fixes #1056
-rw-r--r--discord/opus.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/opus.py b/discord/opus.py
index 788c953e..6003ca7c 100644
--- a/discord/opus.py
+++ b/discord/opus.py
@@ -49,9 +49,10 @@ def _err_lt(result, func, args):
return result
def _err_ne(result, func, args):
- if result.value != 0:
+ ret = args[-1]._obj
+ if ret.value != 0:
log.info('error has happened in {0.__name__}'.format(func))
- raise OpusError(result.value)
+ raise OpusError(ret.value)
return result
# A list of exported functions.