Catch KeyError exception when attempting to import NetFS's NetFSMountURLSync function.

This commit is contained in:
Greg Neagle
2016-10-14 14:27:04 -07:00
parent 84271f6bb8
commit 8fa668edb6
+4 -4
View File
@@ -74,9 +74,9 @@ try:
del NetFS['NetFSMountURLSync']
objc.loadBundleFunctions(
NetFS_bundle, NetFS, [('NetFSMountURLSync', 'i@@@@@@o^@')])
NETFS_AVAILABLE = True
except ImportError:
NETFS_AVAILABLE = False
NETFSMOUNTURLSYNC_AVAILABLE = True
except ImportError, KeyError:
NETFSMOUNTURLSYNC_AVAILABLE = False
class ShareMountException(Exception):
@@ -260,7 +260,7 @@ def mount_repo_cli():
if os.path.exists(REPO_PATH):
return
print 'Attempting to mount fileshare %s:' % REPO_URL
if NETFS_AVAILABLE:
if NETFSMOUNTURLSYNC_AVAILABLE:
# mount the share using the NetFS API
try:
mount_share_url(REPO_URL)