Browse Source

Make the default filename a little bit prettier.

pull/244/head
Rapptz 9 years ago
parent
commit
c3933c379a
  1. 3
      discord/client.py

3
discord/client.py

@ -54,6 +54,7 @@ import tempfile, os, hashlib
import itertools import itertools
import datetime import datetime
from collections import namedtuple from collections import namedtuple
from os.path import split as path_split
PY35 = sys.version_info >= (3, 5) PY35 = sys.version_info >= (3, 5)
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -874,7 +875,7 @@ class Client:
with open(fp, 'rb') as f: with open(fp, 'rb') as f:
buffer = io.BytesIO(f.read()) buffer = io.BytesIO(f.read())
if filename is None: if filename is None:
filename = fp _, filename = path_split(fp)
except TypeError: except TypeError:
buffer = fp buffer = fp

Loading…
Cancel
Save