Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exceptions for pywin32 removal #105

Merged
merged 1 commit into from
Aug 15, 2022
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
3 changes: 1 addition & 2 deletions menuinst/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ def install(path, remove=False, prefix=sys.prefix, recursing=False, root_prefix=
if isUserAdmin():
_install(path, remove, prefix, mode='system', root_prefix=root_prefix)
else:
from pywintypes import error
retcode = 1
try:
if not recursing:
retcode = runAsAdmin([join(root_prefix, 'python'), '-c',
"import menuinst; menuinst.install(%r, %r, %r, %r, %r)" % (
path, bool(remove), prefix, True, root_prefix)])
except error:
except WindowsError:
pass

if retcode != 0:
Expand Down
3 changes: 1 addition & 2 deletions menuinst/win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import logging
import os
from os.path import isdir, join, exists, split
import pywintypes
import sys
import locale

Expand Down Expand Up @@ -202,7 +201,7 @@ def __init__(self, name, prefix=unicode_root_prefix, env_name=u"", mode=None, ro
% (name, self.prefix, env_name, mode, used_mode, root_prefix))
try:
self.set_dir(name, self.prefix, env_name, used_mode, root_prefix)
except (WindowsError, pywintypes.error):
except WindowsError:
# We get here if we aren't elevated. This is different from
# permissions: a user can have permission, but elevation is still
# required. If the process isn't elevated, we get the
Expand Down