Skip to content

Commit a9e21a9

Browse files
committed
setup.py sanity check + pep8 tweaks to mimeparse.py
1 parent 7799be4 commit a9e21a9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

mimeparse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def parse_mime_type(mime_type):
3232

3333
type_parts = full_type.split('/') if '/' in full_type else None
3434
if not type_parts or len(type_parts) > 2:
35-
raise MimeTypeParseException("Can't parse type \"{}\"".format(full_type))
35+
raise MimeTypeParseException(
36+
"Can't parse type \"{}\"".format(full_type))
3637

3738
(type, subtype) = type_parts
3839

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ def get_version(filename):
1515
return re.search("__version__ = ['\"]([^'\"]+)['\"]", contents).group(1)
1616

1717
version = get_version('mimeparse.py')
18+
if not version:
19+
raise RuntimeError('Cannot find version information')
1820

1921

2022
def read(fname):
2123
path = os.path.join(os.path.dirname(__file__), fname)
2224
with codecs.open(path, encoding='utf-8') as fp:
2325
return fp.read()
2426

27+
2528
setup(
2629
name="python-mimeparse",
2730
py_modules=["mimeparse"],

0 commit comments

Comments
 (0)