ยปCore Development>Code coverage>Lib/lib2to3/fixes/fix_ne.py

Python code coverage for Lib/lib2to3/fixes/fix_ne.py

#countcontent
1n/a# Copyright 2006 Google, Inc. All Rights Reserved.
2n/a# Licensed to PSF under a Contributor Agreement.
3n/a
4n/a"""Fixer that turns <> into !=."""
5n/a
6n/a# Local imports
7n/afrom .. import pytree
8n/afrom ..pgen2 import token
9n/afrom .. import fixer_base
10n/a
11n/a
12n/aclass FixNe(fixer_base.BaseFix):
13n/a # This is so simple that we don't need the pattern compiler.
14n/a
15n/a _accept_type = token.NOTEQUAL
16n/a
17n/a def match(self, node):
18n/a # Override
19n/a return node.value == "<>"
20n/a
21n/a def transform(self, node, results):
22n/a new = pytree.Leaf(token.NOTEQUAL, "!=", prefix=node.prefix)
23n/a return new