Note that source compatible scripts may continue to refer to the version agnostic python command without affecting portability
This commit is contained in:
parent
46fb064332
commit
4a7ccd55db
|
@ -48,6 +48,9 @@ Recommendation
|
|||
This distinction should be made in shebangs, when invoking from a shell
|
||||
script, when invoking via the system() call, or when invoking in any other
|
||||
context.
|
||||
* One exception to this is scripts that are deliberately written to be source
|
||||
compatible with both Python 2.x and 3.x. Such scripts may continue to use
|
||||
``python`` on their shebang line without affecting their portability.
|
||||
* When reinvoking the interpreter from a Python script, querying
|
||||
``sys.executable`` to avoid hardcoded assumptions regarding the
|
||||
interpreter location remains the preferred approach.
|
||||
|
|
Loading…
Reference in New Issue