aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-06-12 23:43:03 -0400
committerRapptz <[email protected]>2016-06-12 23:43:03 -0400
commitc3933c379a5a473e5738572eb975e80a8aaa26fa (patch)
treec6dc7699a1ec517635f3930af89d54637a40698e
parentFix bug with login token not being properly written in cache. (diff)
downloaddiscord.py-c3933c379a5a473e5738572eb975e80a8aaa26fa.tar.xz
discord.py-c3933c379a5a473e5738572eb975e80a8aaa26fa.zip
Make the default filename a little bit prettier.
-rw-r--r--discord/client.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/discord/client.py b/discord/client.py
index 61a8f86a..ddf35c7a 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -54,6 +54,7 @@ import tempfile, os, hashlib
import itertools
import datetime
from collections import namedtuple
+from os.path import split as path_split
PY35 = sys.version_info >= (3, 5)
log = logging.getLogger(__name__)
@@ -874,7 +875,7 @@ class Client:
with open(fp, 'rb') as f:
buffer = io.BytesIO(f.read())
if filename is None:
- filename = fp
+ _, filename = path_split(fp)
except TypeError:
buffer = fp