gikoluo / aliyun-mns

阿里云 MNS SDK for Python
MIT License
16 stars 16 forks source link

connect异常处理代码BUG触发UnboundLocalError #2

Open yousong opened 1 year ago

yousong commented 1 year ago

https://github.com/gikoluo/aliyun-mns/blob/b375d765e1128571d8023a303ef941ed3e65ce6c/mns/mns_http.py#L33-L53

示例如下

def f():
    msg = 'abc'
    for i in range(10):
        try:
            raise Exception('hi')
        except Exception as msg:
            pass
    print(msg)

f()
yousong commented 1 year ago

相关python issue:https://bugs.python.org/issue40728