ez_setup.py 文件源码

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

项目:Adafruit_Python_PureIO 作者: adafruit 项目源码 文件源码
def get_zip_class():
    """
    Supplement ZipFile class to support context manager for Python 2.6
    """
    class ContextualZipFile(zipfile.ZipFile):
        def __enter__(self):
            return self
        def __exit__(self, type, value, traceback):
            self.close
    return zipfile.ZipFile if hasattr(zipfile.ZipFile, '__exit__') else \
        ContextualZipFile
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号