If there are multiple wheels that match, load the latest one.

This should allow users to upgrade the addon by overwriting an older
version, instead of requiring a remove-and-install sequence.
This commit is contained in:
Sybren A. Stüvel 2016-06-28 15:31:56 +02:00
parent 822c8daf07
commit 586905a183

View File

@ -31,7 +31,9 @@ def load_wheel(module_name, fname_prefix):
if not wheels: if not wheels:
raise RuntimeError('Unable to find wheel at %r' % path_pattern) raise RuntimeError('Unable to find wheel at %r' % path_pattern)
sys.path.append(wheels[0]) # If there are multiple wheels that match, load the latest one.
wheels.sort()
sys.path.append(wheels[-1])
module = __import__(module_name) module = __import__(module_name)
log.debug('Loaded %s from %s', module_name, module.__file__) log.debug('Loaded %s from %s', module_name, module.__file__)