Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit 7d6bd43

Browse files
Merge pull request #74 from SethMichaelLarson/fix-set-attr
Fix error when using setattr on COM interface with Enum.
2 parents 6685a0f + 23dc6e2 commit 7d6bd43

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ master
88
* Add sys.executable-derived paths in list to check for vboxapi (@SethMichaelLarson PR #69)
99
* Fix IGuestProcess.execute() on Python 3.x (@SethMichaelLarson PR #58)
1010
* Fix errors to not output on Windows platforms. (@SethMichaelLarson PR #57)
11+
* Fix error caused by attempting to set any attribute in the COM interface
12+
using setattr raising an error. (Reported by @josepegerent, patch by @SethMichaelLarson PR #74)
1113

1214
version 1.0.0
1315

virtualbox/library_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ def _set_attr(self, name, value):
164164
if inspect.isfunction(attr) or inspect.ismethod(attr):
165165
return self._call_method(attr, value)
166166
else:
167+
if isinstance(value, Enum):
168+
value = int(value)
167169
return setattr(self._i, name, value)
168170

169171
def _call(self, name, in_p=None):

0 commit comments

Comments
 (0)