Change set ops to use methods instead of operators.

This commit is contained in:
Antony Lee 2017-12-13 00:54:57 -08:00
parent 8ce6e39b1c
commit 45e7734b1a
1 changed files with 3 additions and 2 deletions

View File

@ -179,8 +179,9 @@ class AssertionRewritingHook(object):
The named module or package as well as any nested modules will
be rewritten on import.
"""
already_imported = (
(set(names) & set(sys.modules)) - set(self._rewritten_names))
already_imported = (set(names)
.intersection(sys.modules)
.difference(self._rewritten_names))
for name in already_imported:
if not AssertionRewriter.is_rewrite_disabled(
sys.modules[name].__doc__ or ""):