mirror of https://github.com/tLDP/python-tldp
fix guess(non-string) with Python 3.6
The os.path.* functions now consistently raise TypeError rather than something more random when called with inappropriate types. Fixes #6
This commit is contained in:
parent
f3f06f372f
commit
21cfd681b9
|
@ -57,7 +57,7 @@ def guess(fname):
|
||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
stem, ext = os.path.splitext(fname)
|
stem, ext = os.path.splitext(fname)
|
||||||
except AttributeError:
|
except (AttributeError, TypeError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if not ext:
|
if not ext:
|
||||||
|
|
Loading…
Reference in New Issue