__init__.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:browser_vuln_check 作者: lcatro 项目源码 文件源码
def testExtractConst(self):
        if not hasattr(dep, 'extract_constant'):
            # skip on non-bytecode platforms
            return

        def f1():
            global x, y, z
            x = "test"
            y = z

        fc = six.get_function_code(f1)

        # unrecognized name
        assert dep.extract_constant(fc, 'q', -1) is None

        # constant assigned
        dep.extract_constant(fc, 'x', -1) == "test"

        # expression assigned
        dep.extract_constant(fc, 'y', -1) == -1

        # recognized name, not assigned
        dep.extract_constant(fc, 'z', -1) is None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号