Skip to content

Commit

Permalink
fix issue when empty install prefix specified (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibtaylor authored and mikepurvis committed Mar 25, 2019
1 parent 1d2d19a commit 08d05fb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,16 @@ def run(self):
parser.add_argument('--prefix', default=None)

opts, _ = parser.parse_known_args(sys.argv)
userbase = site.getuserbase() if opts.user else None
prefix = userbase or opts.prefix or sys.prefix
if opts.user and not (opts.prefix == None or opts.prefix == ""):
raise Exception("error: argument --prefix: must be unspecified or empty if given with argument --user/--home")

prefix = None
if opts.user:
prefix = site.getuserbase()
elif opts.prefix != None:
prefix = opts.prefix
else:
prefix = sys.prefix

setup(
name='catkin_tools',
Expand Down

0 comments on commit 08d05fb

Please sign in to comment.