Make the default filename a little bit prettier.

This commit is contained in:
Rapptz 2016-06-12 23:43:03 -04:00
parent 3895cf9295
commit c3933c379a

View File

@ -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