recipe-252495.py 文件源码

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

项目:code 作者: ActiveState 项目源码 文件源码
def unlock(self):
        '''does not raise an exception,
        safe to unlock as often as you want
        it may just do nothing'''
        if self.locked.has_key(self.d2):
            #we're the ones that unlocked it,
            #if time matched
            if self.locked[self.d2]==\
               os.stat(self.d2)[8]:
                try:
                    del(self.locked[self.d2])
                    os.rmdir(self.d2)
                    os.rmdir(self.d)
                    return 1
                except:
                    return 0
            else:
                del(self.locked[self.d2])
            return 0
        else:
            return 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号