/usr/lib/python2.7/dist-packages/logilab/astng/brain/py2mechanize.py is in python-logilab-astng 0.24.3-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from logilab.astng import MANAGER
from logilab.astng.builder import ASTNGBuilder
def mechanize_transform(module):
fake = ASTNGBuilder(MANAGER).string_build('''
class Browser(object):
def open(self, url, data=None, timeout=None):
return None
def open_novisit(self, url, data=None, timeout=None):
return None
def open_local_file(self, filename):
return None
''')
module.locals['Browser'] = fake.locals['Browser']
import py2stdlib
py2stdlib.MODULE_TRANSFORMS['mechanize'] = mechanize_transform
|