From cbbe3ae9d970cbf4c495358077b6048e0f2476c8 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sun, 30 Jan 2022 13:30:31 -0500 Subject: [PATCH] Run tox -e lint --- environs/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/environs/__init__.py b/environs/__init__.py index 3692d52..ef13d64 100644 --- a/environs/__init__.py +++ b/environs/__init__.py @@ -113,7 +113,7 @@ def method( source_key = proxied_key or parsed_key if value is ma.missing: if self.eager: - raise EnvError('Environment variable "{}" not set'.format(proxied_key or parsed_key)) + raise EnvError(f'Environment variable "{proxied_key or parsed_key}" not set') else: self._errors[parsed_key].append("Environment variable not set.") return None @@ -124,7 +124,7 @@ def method( except ma.ValidationError as error: if self.eager: raise EnvValidationError( - 'Environment variable "{}" invalid: {}'.format(source_key, error.args[0]), error.messages + f'Environment variable "{source_key}" invalid: {error.args[0]}', error.messages ) from error self._errors[parsed_key].extend(error.messages) else: @@ -150,7 +150,7 @@ def method( source_key = proxied_key or parsed_key if raw_value is ma.missing: if self.eager: - raise EnvError('Environment variable "{}" not set'.format(proxied_key or parsed_key)) + raise EnvError(f'Environment variable "{proxied_key or parsed_key}" not set') else: self._errors[parsed_key].append("Environment variable not set.") return None @@ -164,7 +164,7 @@ def method( messages = error.messages if isinstance(error, ma.ValidationError) else [error.args[0]] if self.eager: raise EnvValidationError( - 'Environment variable "{}" invalid: {}'.format(source_key, error.args[0]), messages + f'Environment variable "{source_key}" invalid: {error.args[0]}', messages ) from error self._errors[parsed_key].extend(messages) else: