Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change log
==========

master

* Add sys.executable-derived paths in list to check for vboxapi (@SethMichaelLarson PR #69)
* Fix IGuestProcess.execute() on Python 3.x (@SethMichaelLarson PR #58)
* Fix errors to not output on Windows platforms. (@SethMichaelLarson PR #57)

version 1.0.0

* Support for 5.0.x VirtualBox.
Expand All @@ -10,7 +16,7 @@ version 1.0.0

version 0.2.2

* Cleanup managers at exiti (reported by @jiml521).
* Cleanup managers at exit (reported by @jiml521).
* Add three time check for attribute in xpcom interface object before failing (reported
by @shohamp).
* Update library.py to 4.3.28/src/VBox/Main/idl/VirtualBox.xidl
Expand Down
18 changes: 17 additions & 1 deletion virtualbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,23 @@ def import_vboxapi():
search = ['/Library/Python/%s.%s/site-packages' % py_mm_ver]
else:
# No idea where to look...
raise
search = []

# Generates a common prefix from sys.executable in the
# case that vboxapi is installed in a virtualenv.
# This will also help with when we don't know where
# to search because of an unknown platform.
# These paths also help if the system Python is installed
# in a non-standard location.
#
# NOTE: We don't have to worry if these directories don't
# exist as they're checked below.
prefix = os.path.dirname(os.path.dirname(sys.executable))
search.extend([os.path.join(prefix, 'Lib', 'site-packages'),
os.path.join(prefix, 'Lib', 'site-packages', 'win32'),
os.path.join(prefix, 'Lib', 'site-packages', 'win32', 'lib'),
os.path.join(prefix, 'lib', 'site-packages'),
os.path.join(prefix, 'lib', 'dist-packages')])

packages = set(packages)
original_path = copy.copy(sys.path)
Expand Down