Skip to content

Commit

Permalink
Allow post and config arguments to be None.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Jul 24, 2017
1 parent 37eb408 commit 5ebf564
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nikola/metadata_extractors.py
Expand Up @@ -73,10 +73,10 @@ def check_conditions(post, filename: str, conditions: list, config: dict, source
"""Check the conditions for a metadata extractor."""
for ct, arg in conditions:
if any((
ct == MetaCondition.config_bool and not config.get(arg, False),
ct == MetaCondition.config_bool and (config is None or not config.get(arg, False)),
ct == MetaCondition.config_present and arg not in config,
ct == MetaCondition.extension and not filename.endswith(arg),
ct == MetaCondition.compiler and post.compiler.name != arg,
ct == MetaCondition.compiler and (post is None or post.compiler.name != arg),
ct == MetaCondition.never
)):
return False
Expand Down

0 comments on commit 5ebf564

Please sign in to comment.