summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2018-06-23 14:57:53 +0000
committerChristos Zoulas <christos@zoulas.com>2018-06-23 14:57:53 +0000
commitda66447fb6981ddee11fb0906df075db2f154cdc (patch)
tree38609ec6218862f6b28ef53c795d183e28bd01fc /python
parentcc32246d2aa7cc6ecc2071d1d6ea3c6a7015f2f2 (diff)
downloadfile-git-da66447fb6981ddee11fb0906df075db2f154cdc.tar.gz
PR/7: Return the proper ValueError message
Diffstat (limited to 'python')
-rw-r--r--python/magic.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/magic.py b/python/magic.py
index 662569e8..377b5552 100644
--- a/python/magic.py
+++ b/python/magic.py
@@ -248,7 +248,10 @@ none_magic.load()
def _create_filemagic(mime_detected, type_detected):
- mime_type, mime_encoding = mime_detected.split('; ')
+ try:
+ mime_type, mime_encoding = mime_detected.split('; ')
+ except ValueError:
+ raise ValueError(mime_detected)
return FileMagic(name=type_detected, mime_type=mime_type,
encoding=mime_encoding.replace('charset=', ''))