File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments