verifiers.py (11410:e51095583654) verifiers.py (11449:4511f239d1ba)
1#!/usr/bin/env python
2#
3# Copyright (c) 2014, 2016 ARM Limited
4# All rights reserved
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 43 unchanged lines hidden (view full) ---

52import sys
53
54import style
55import sort_includes
56from region import *
57from file_types import lang_type
58
59def _modified_regions(old, new):
1#!/usr/bin/env python
2#
3# Copyright (c) 2014, 2016 ARM Limited
4# All rights reserved
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 43 unchanged lines hidden (view full) ---

52import sys
53
54import style
55import sort_includes
56from region import *
57from file_types import lang_type
58
59def _modified_regions(old, new):
60 m = SequenceMatcher(a=old, b=new, autojunk=False)
61
60 try:
61 m = SequenceMatcher(a=old, b=new, autojunk=False)
62 except TypeError:
63 # autojunk was introduced in Python 2.7. We need a fallback
64 # mechanism to support old Python versions.
65 m = SequenceMatcher(a=old, b=new)
62 regions = Regions()
63 for tag, i1, i2, j1, j2 in m.get_opcodes():
64 if tag != "equal":
65 regions.extend(Region(i1, i2))
66 return regions
67
68
69class Verifier(object):

--- 324 unchanged lines hidden ---
66 regions = Regions()
67 for tag, i1, i2, j1, j2 in m.get_opcodes():
68 if tag != "equal":
69 regions.extend(Region(i1, i2))
70 return regions
71
72
73class Verifier(object):

--- 324 unchanged lines hidden ---