Files
ports/lang/tauthon/files/patch-Lib_distutils_command_install__lib.py
T
Matthias Andree 46ce70a6d4 [NEW] lang/tauthon: Backwards-compatible fork of Python 2.7 interpreter with Python 3.x features
------------------------------------------------------------------------------
Note this is not fully connected yet, and needs further changes to integrate
with flavors, addition to Mk/Uses/python.mk (or some equivalent USES=tauthon)
that may need discussion first, for instance, on the package name prefix.

This is committed to serve as a common test bed and for experimentation.
------------------------------------------------------------------------------

Maintainer:	olce.freebsd.ports@certner.fr (Olivier Certner)

Tauthon is a backward-compatible fork of Python's 2.7.18 interpreter with new
syntax, builtins, and libraries backported from Python 3.x.

Python code and C-extensions targeting Python 2.7 or below are expected to run
unmodified on Tauthon and produce the same output. But with Tauthon, that code
can now use some of the new features from Python 3.x.

This is not an official Python release. Because of its new features, while
preserving 2.7 compatibility, Tauthon reports 2.8 as its major/minor versions.

Non-exhaustive list of new features:
- Function Annotations
- Keyword-Only Arguments
- "async" and "await" Syntax
- Argument-less "super"
- New Metaclass Syntax
- "nonlocal"
- "yield from" Syntax
- "concurrent.futures" Module
- UTF-8 as the default source encoding

WWW: https://github.com/naftaliharris/tauthon

(Committed with minor changes over submission, particularly a few reorderings
in Makefile to appease portlint -CA.)

PR:		251019
Submitted by:	Olivier Certner (maintainer)
2020-12-11 08:44:45 +00:00

35 lines
1.3 KiB
Python

From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001
From: Brendan Molloy <brendan@bbqsrc.net>
Date: Mon, 4 Jan 2016 23:14:06 +1100
Subject: [PATCH] Check bytecode file actually exists and tests
Should solve issue 20397, where using the --record argument results
in files that failed to generate bytecode files are added to the
record file nonetheless.
---
Lib/distutils/command/install_lib.py | 17 +++++++++++++----
Lib/distutils/tests/test_install_lib.py | 8 ++++++--
2 files changed, 19 insertions(+), 6 deletions(-)
--- Lib/distutils/command/install_lib.py.orig 2015-12-05 19:46:56 UTC
+++ Lib/distutils/command/install_lib.py
@@ -168,10 +168,14 @@ class install_lib(Command):
ext = os.path.splitext(os.path.normcase(py_file))[1]
if ext != PYTHON_SOURCE_EXTENSION:
continue
- if self.compile:
- bytecode_files.append(py_file + "c")
- if self.optimize > 0:
- bytecode_files.append(py_file + "o")
+
+ pyc_file = py_file + "c"
+ if self.compile and os.path.isfile(pyc_file):
+ bytecode_files.append(pyc_file)
+
+ pyo_file = py_file + "o"
+ if self.optimize > 0 and os.path.isfile(pyo_file):
+ bytecode_files.append(pyo_file)
return bytecode_files