diff options
| author | Christos Zoulas <christos@zoulas.com> | 2018-06-23 14:57:53 +0000 |
|---|---|---|
| committer | Christos Zoulas <christos@zoulas.com> | 2018-06-23 14:57:53 +0000 |
| commit | da66447fb6981ddee11fb0906df075db2f154cdc (patch) | |
| tree | 38609ec6218862f6b28ef53c795d183e28bd01fc /python | |
| parent | cc32246d2aa7cc6ecc2071d1d6ea3c6a7015f2f2 (diff) | |
| download | file-git-da66447fb6981ddee11fb0906df075db2f154cdc.tar.gz | |
PR/7: Return the proper ValueError message
Diffstat (limited to 'python')
| -rw-r--r-- | python/magic.py | 5 |
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=', '')) |
