Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address the review
  • Loading branch information
arhadthedev authored Apr 15, 2023
commit f0c1bf701e559aeee1bcd34a17087b609bc7facd
6 changes: 2 additions & 4 deletions Lib/mimetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ def add_type(self, type, ext, strict=True):
valid, so a ValueError will be raised if they are
specified.
"""
if not ext:
warnings.warn('Empty extension specified')
elif not ext.startswith('.'):
raise ValueError("Extensions should start with a '.'")
if ext and not ext.startswith('.'):
raise ValueError("Extensions should start with a '.' or be empty")
self.types_map[strict][ext] = type
exts = self.types_map_inv[strict].setdefault(type, [])
if ext not in exts:
Expand Down