mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Till Toenshoff via Review Board <nore...@reviews.apache.org>
Subject Re: Review Request 68951: Updated verify-reviews.py to use current interpreter in subprocesses.
Date Mon, 08 Oct 2018 18:12:07 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68951/#review209317
-----------------------------------------------------------




support/verify-reviews.py
Line 97 (original), 97 (patched)
<https://reviews.apache.org/r/68951/#comment293632>

    IIUC, then `sys.executable` may be `None`. Shall we guard against that?


- Till Toenshoff


On Oct. 8, 2018, 6:06 p.m., Armand Grillet wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68951/
> -----------------------------------------------------------
> 
> (Updated Oct. 8, 2018, 6:06 p.m.)
> 
> 
> Review request for mesos, Till Toenshoff and Vinod Kone.
> 
> 
> Bugs: MESOS-9253
>     https://issues.apache.org/jira/browse/MESOS-9253
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This changes the command used in `support/verify-reviews.py` when
> running `support/apply-reviews.py` as a subprocess. It was previously
> `"python"`, which is generally Python 2, and is now `sys.executable`.
> 
> That way, if verify-reviews.py is run with Python 3 (as it should),
> apply-reviews.py will be run with the same Python 3 interpreter. This
> should fix the `ImportError` issues we have recently seen in our CI.
> 
> 
> Diffs
> -----
> 
>   support/verify-reviews.py 56321ae65b38a1c62f5589b6a8aaa3993fa3dd5f 
> 
> 
> Diff: https://reviews.apache.org/r/68951/diff/1/
> 
> 
> Testing
> -------
> 
> I have created a simple `test.py` file to check that the interpreter was correctly found:
> 
> ```
> import sys
> 
> 
> def apply_review(review_id):
>     """Apply a review using the script apply-reviews.py."""
>     print("Applying review %s" % review_id)
>     print("%s support/apply-reviews.py -n -r %s" % (sys.executable, review_id))
> 
> apply_review(1337)
> apply_review("1337")
> ```
> 
> In both cases, `python3 test.py` prints `/usr/local/bin/python3 support/apply-reviews.py
-n -r 1337` which is what I expected.
> 
> 
> Thanks,
> 
> Armand Grillet
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message