Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1ae688b

Browse files
author
stonebig
committed
make 'wppm -u' work
1 parent 47c1692 commit 1ae688b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

winpython/wppm.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -754,20 +754,21 @@ def main(test=False):
754754
if not args.install and not args.uninstall:
755755
args.install = True
756756

757-
if not osp.isfile(args.fname):
757+
if not osp.isfile(args.fname) and args.install:
758758
raise IOError("File not found: %s" % args.fname)
759759

760760
if utils.is_python_distribution(args.target):
761761
dist = Distribution(args.target)
762762
try:
763-
package = Package(args.fname)
764-
if package.is_compatible_with(dist):
765-
if args.install:
766-
dist.install(package)
767-
else:
768-
dist.uninstall(package)
763+
if args.uninstall:
764+
package = dist.find_package(args.fname)
765+
dist.uninstall(package)
769766
else:
770-
raise RuntimeError("Package is not compatible with Python "\
767+
package = Package(args.fname)
768+
if args.install and package.is_compatible_with(dist):
769+
dist.install(package)
770+
else:
771+
raise RuntimeError("Package is not compatible with Python "\
771772
"%s %dbit" % (dist.version, dist.architecture))
772773
except NotImplementedError:
773774
raise RuntimeError("Package is not (yet) supported by WPPM")

0 commit comments

Comments
 (0)