dict.has_key() was removed in Python 3.x.
This sed regex could fix them all:
sed -r "s/([a-z,A-Z,0-9,.,_]*)\.has_key\('([^']*)'\)/'\2' in \1/g" \ -i `find -name "*.py"`
Enjoy.
dict.has_key() was removed in Python 3.x.
This sed regex could fix them all:
sed -r "s/([a-z,A-Z,0-9,.,_]*)\.has_key\('([^']*)'\)/'\2' in \1/g" \ -i `find -name "*.py"`
Enjoy.
Also 2to3 fixes that and many other changes.
Pingback: Leo Iannacone: Python3 – has_key() regex replace | Hi-tech news