def METHOD_NAME(var):
    """Define 'msg' in one handler nested under with statement."""
    try:
        return 1 / var.some_other_func()
    except AttributeError:
        pass
    except ZeroDivisionError:
        with open(__file__, encoding='utf-8') as my_file:
            msg = "Division by 0"
            my_file.write("****")
    print(msg)  # [used-before-assignment]