summaryrefslogtreecommitdiff
path: root/scripts/fix_b.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-08-15 01:55:57 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-08-15 01:56:36 +0100
commit78649f8e905f04c3000abef23725d557a103abef (patch)
tree60afa4c1829f9a0068ae9ea34ef3374eb86fd0f8 /scripts/fix_b.py
parent3b41c3a6f373af0100a399cea150a9420ecc4acb (diff)
downloadpsycopg2-78649f8e905f04c3000abef23725d557a103abef.tar.gz
Dropped use of b() "macro" and 2to3 fixer
Just use the b"" strings syntax supported from python 2.6.
Diffstat (limited to 'scripts/fix_b.py')
-rw-r--r--scripts/fix_b.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/scripts/fix_b.py b/scripts/fix_b.py
deleted file mode 100644
index ccc8e1c..0000000
--- a/scripts/fix_b.py
+++ /dev/null
@@ -1,20 +0,0 @@
-"""Fixer to change b('string') into b'string'."""
-# Author: Daniele Varrazzo
-
-import token
-from lib2to3 import fixer_base
-from lib2to3.pytree import Leaf
-
-class FixB(fixer_base.BaseFix):
-
- PATTERN = """
- power< wrapper='b' trailer< '(' arg=[any] ')' > rest=any* >
- """
-
- def transform(self, node, results):
- arg = results['arg']
- wrapper = results["wrapper"]
- if len(arg) == 1 and arg[0].type == token.STRING:
- b = Leaf(token.STRING, 'b' + arg[0].value, prefix=wrapper.prefix)
- node.children = [ b ] + results['rest']
-