Skip to content

Commit

Permalink
mark a couple cli import failure lines as uncovered
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud committed Nov 26, 2023
1 parent 1336a7c commit cbd7e8d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions glom/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,19 @@ def mw_handle_target(target_text, target_format):
try:
import yaml
load_func = yaml.safe_load
except ImportError:
raise UsageError('No YAML package found. To process yaml files, run: pip install PyYAML')
except ImportError: # pragma: no cover
raise UsageError('No YAML package found. To process yaml files, run: pip install PyYAML') # pragma: no cover
elif target_format == 'toml':
missing = UsageError('No TOML package found. To process toml files, upgrade to Python 3.11 or run: pip install tomli')
try:
import tomllib
import tomllib
load_func = tomllib.loads
except ImportError:
try:
import tomli
load_func = tomli.loads
except ImportError:
raise missing
except ImportError: # pragma: no cover
raise missing # pragma: no cover
elif target_format == 'python':
load_func = ast.literal_eval
else:
Expand Down

0 comments on commit cbd7e8d

Please sign in to comment.