diff options
| author | David Malcolm <dmalcolm@redhat.com> | 2009-11-20 14:30:24 -0500 |
|---|---|---|
| committer | David Malcolm <dmalcolm@redhat.com> | 2009-11-20 14:30:24 -0500 |
| commit | 2936118b94420798c827733844df8a4ea949b280 (patch) | |
| tree | 4f7b667a1a5fd55f6cb53e3be4a4c560622eeb78 | |
| parent | e9365c606a134c4ea96986066d4f9df26d2af896 (diff) | |
| download | 2to3c-2936118b94420798c827733844df8a4ea949b280.tar.gz 2to3c-2936118b94420798c827733844df8a4ea949b280.tar.xz 2to3c-2936118b94420798c827733844df8a4ea949b280.zip | |
Remove redundant code; add note about the file's purpose
| -rw-r--r-- | fixes/typeobject.py | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/fixes/typeobject.py b/fixes/typeobject.py index 1710a74..b0c9004 100644 --- a/fixes/typeobject.py +++ b/fixes/typeobject.py @@ -1,6 +1,11 @@ import sys import re -from difflib import unified_diff + +# I wasn't able to express this refactoring in SmPLs; the implied comma embedded +# in the _HEAD_INIT macros seems to be too much for spatch to reasonably deal +# with. + +# So I expressed this one as a regex. # Whitespace patterns: req_ws = r'\s+' @@ -46,21 +51,5 @@ PyTypeObject DBusPyIntBase_Type = { "_dbus_bindings._IntBase", ''' ) - - -def fixup_file(filename, options): - content = open(filename, 'r').read() - fixed_content = fixup_typeobject_initializers(content) - if content != fixed_content: - for line in unified_diff(content.splitlines(), - fixed_content.splitlines(), - fromfile = filename+'.orig', - tofile = filename, - lineterm=''): - print line - - if options.write: - open(filename, 'w').write(fixed_content) - if __name__ == '__main__': unittest.main() |
