From ab702f533ba11faad942e30ed8599e16b686c83f Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Mon, 5 Dec 2022 12:45:53 +0100 Subject: [PATCH] annotations: prevent generating .pyc files on import We may end up adding these files to our git repos by mistake, so simply prevent generating them in advance. There's a tiny performance penalty with this change, because python needs to re-generate the bytecode on-the-fly every time the annotations script is called, but this overhead is absolutely negligible compared the rest of the kernel build time. Signed-off-by: Andrea Righi --- annotations | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/annotations b/annotations index 97232b6..7138e49 100755 --- a/annotations +++ b/annotations @@ -3,8 +3,9 @@ # Manage Ubuntu kernel .config and annotations # Copyright © 2022 Canonical Ltd. -import argparse import sys +sys.dont_write_bytecode = True +import argparse import json from kconfig.annotations import Annotation, KConfig -- 2.31.1