Fix broken winreg imports

This commit is contained in:
Dave Parsons 2015-10-14 19:09:10 +01:00
parent 984ccbc1d1
commit 490cb90af8
2 changed files with 7 additions and 4 deletions

View File

@ -88,16 +88,19 @@ def main():
parser.clean()
# Download the darwin.iso tgz file
print 'Retrieving tools from: ' + url
urllib.urlretrieve(url, convertPath(dir + '/tools/com.vmware.fusion.tools.darwin.zip.tar'))
# Extract the tar to zip
tar = tarfile.open(convertPath(dir + '/tools/com.vmware.fusion.tools.darwin.zip.tar'), 'r')
tar.extract('com.vmware.fusion.tools.darwin.zip', path=convertPath(dir + '/tools/'))
tar.close()
# Extract the iso and sig files from zip
zip = zipfile.ZipFile(convertPath(dir + '/tools/com.vmware.fusion.tools.darwin.zip'), 'r')
zip.extract('payload/darwin.iso', path=convertPath(dir + '/tools/'))
zip.extract('payload/darwin.iso.sig', path=convertPath(dir + '/tools/'))
zip.close()
# Move the iso and sig files to tools folder
shutil.move(convertPath(dir + '/tools/payload/darwin.iso'), convertPath(dir + '/tools/darwin.iso'))

View File

@ -50,10 +50,10 @@ if sys.version_info < (2, 7):
sys.exit(1)
# Setup imports depending on whether IronPython or CPython
try:
import _winreg
except ImportError:
pass
if sys.platform == 'win32' \
or sys.platform == 'cli':
from _winreg import *
def rot13(s):
chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'