summaryrefslogtreecommitdiffstats
path: root/2to3c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2009-11-20 15:13:05 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2009-11-20 15:13:05 -0500
commit1cc12923d5b14848bd153e0eee96770073483302 (patch)
treed0dbce224ae7b947e936f8233ca9e3d5a4e18094 /2to3c
parent2936118b94420798c827733844df8a4ea949b280 (diff)
download2to3c-1cc12923d5b14848bd153e0eee96770073483302.tar.gz
2to3c-1cc12923d5b14848bd153e0eee96770073483302.tar.xz
2to3c-1cc12923d5b14848bd153e0eee96770073483302.zip
Use "Fixes" classes for both python and .cocci fix implementations; invoke the .cocci files from 2to3c
Diffstat (limited to '2to3c')
-rwxr-xr-x2to3c10
1 files changed, 7 insertions, 3 deletions
diff --git a/2to3c b/2to3c
index c6c96d7..2be282d 100755
--- a/2to3c
+++ b/2to3c
@@ -1,13 +1,17 @@
#!/usr/bin/env python
def get_fixers():
- from fixes.typeobject import fixup_typeobject_initializers
- return [fixup_typeobject_initializers]
+ from fixes.typeobject import FixTypeobjectInitializers
+ from fixes import CocciFix
+ fixes = [FixTypeobjectInitializers()]
+ for filename in ['RO.cocci', 'int-to-long.cocci', 'ob_type.cocci', 'repr.cocci']:
+ fixes.append(CocciFix(filename))
+ return fixes
def fixup_content(content):
# Apply the various fixers, in turn:
for fixer in get_fixers():
- content = fixer(content)
+ content = fixer.transform(content)
return content