From: Andrea Righi Date: Mon, 5 Dec 2022 11:45:53 +0000 (+0100) Subject: annotations: prevent generating .pyc files on import X-Git-Tag: v0.1~49 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=ab702f533ba11faad942e30ed8599e16b686c83f;p=annotations.git 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 --- 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