File tree 1 file changed +9
-8
lines changed 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):
754
754
if not args .install and not args .uninstall :
755
755
args .install = True
756
756
757
- if not osp .isfile (args .fname ):
757
+ if not osp .isfile (args .fname ) and args . install :
758
758
raise IOError ("File not found: %s" % args .fname )
759
759
760
760
if utils .is_python_distribution (args .target ):
761
761
dist = Distribution (args .target )
762
762
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 )
769
766
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 " \
771
772
"%s %dbit" % (dist .version , dist .architecture ))
772
773
except NotImplementedError :
773
774
raise RuntimeError ("Package is not (yet) supported by WPPM" )
You can’t perform that action at this time.
0 commit comments