From 4e50bb709ff5345be02d34ac0bbd9035d3ed50cf Mon Sep 17 00:00:00 2001 From: OKelt Date: Tue, 12 Nov 2019 21:29:41 -0800 Subject: [PATCH] Terminal._load_mailcaps defaults to simple mailcap.getcaps() if XDG_CONFIG_HOME/tuir/mailcap does not exist --- tuir/terminal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tuir/terminal.py b/tuir/terminal.py index 9af8174..723bb59 100644 --- a/tuir/terminal.py +++ b/tuir/terminal.py @@ -70,8 +70,10 @@ class Terminal(object): mime_parsers.ImgurApiMIMEParser.CLIENT_ID = config['imgur_client_id'] def _load_mailcaps(self): - mailcaps_env = 'MAILCAPS' mailcap_file = self.config.MAILCAP + if not os.path.exists(mailcap_file): + return mailcap.getcaps() + mailcaps_env = 'MAILCAPS' caps = dict() # Prepends application-specific mailcap file to MAILCAPS env # This allows mailcap.getcaps to read it before other mailcap files