'exceptions.RuntimeError' - 对象没有属性 'errno' [英] 'exceptions.RuntimeError' - Object has no attribute 'errno'

查看:53
本文介绍了'exceptions.RuntimeError' - 对象没有属性 'errno'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Maya 2018,但发生了一件奇怪的事情.当我选择多个顶点、面或边时,我得到:

I'm working with Maya 2018 and there's a weird thing going on. When I select multiple vertices, faces or edges I get:

// Error: AttributeError: file <string> line 88: 'exceptions.RuntimeError' object has no attribute 'errno' // 
// Warning: Python callback failed // 

我正在编写脚本的问题在于,当出现此警告/错误时,不知何故它不允许我单击我的自定义 GUI 按钮.例如.我需要选择几个顶点,然后单击一个按钮将它们保存到自定义属性中...好吧,我无法立即单击该按钮,我猜是因为这个奇怪的错误.

The problem with this in what I'm scripting is that when this warning/error appears, somehow it does not let me click on my custom GUI buttons. For example. I need to select a few vertices then click a button to save them into a custom attribute... Well I can't click that button right away, and I'm guessing it is because of this weird error.

关于这是什么的任何想法?

Any ideas on what this is?

推荐答案

在您的脚本的第 88 行中,您正在尝试使用 RuntimeError 实例的属性 errno 但这异常类没有这样的属性.
在尝试处理异常之前,请阅读异常文档.

In line 88 of your script you're trying to use attribute errno of RuntimeError instance but this exception class has no such attribute.
Read documentation of exceptions before trying to handle them.

属性 errno 仅在 OSError<中定义/a> 和从它继承的类.
显然,第 88 行是 try...except 子句的一部分,并且在该行中您尝试使用 e.errno.如果异常不属于 OSError 异常系列,则不能这样做.

Atrribute errno is defined only in OSError and classes inheriting from it.
So apparently line 88 is part of try...except clause and in that line you're trying to use e.errno. You can't do that if the exception doesn't belong to OSError exceptions family.

这篇关于'exceptions.RuntimeError' - 对象没有属性 'errno'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆