[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: python3 script header and rhel8
From: |
Stefan Hajnoczi |
Subject: |
Re: python3 script header and rhel8 |
Date: |
Wed, 29 Jan 2020 15:58:06 +0000 |
On Tue, Jan 28, 2020 at 04:07:47PM +0000, Daniel P. Berrangé wrote:
> On Tue, Jan 28, 2020 at 03:44:04PM +0000, Vladimir Sementsov-Ogievskiy wrote:
> > scripts/tracetool/__init__.py
> > scripts/tracetool/backend/__init__.py
> > scripts/tracetool/backend/dtrace.py
> > scripts/tracetool/backend/ftrace.py
> > scripts/tracetool/backend/log.py
> > scripts/tracetool/backend/simple.py
> > scripts/tracetool/backend/syslog.py
> > scripts/tracetool/backend/ust.py
> > scripts/tracetool/format/__init__.py
> > scripts/tracetool/format/c.py
> > scripts/tracetool/format/d.py
> > scripts/tracetool/format/h.py
> > scripts/tracetool/format/log_stap.py
> > scripts/tracetool/format/simpletrace_stap.py
> > scripts/tracetool/format/stap.py
> > scripts/tracetool/format/tcg_h.py
> > scripts/tracetool/format/tcg_helper_c.py
> > scripts/tracetool/format/tcg_helper_h.py
> > scripts/tracetool/format/tcg_helper_wrapper_h.py
> > scripts/tracetool/format/ust_events_c.py
> > scripts/tracetool/format/ust_events_h.py
> > scripts/tracetool/transform.py
> > scripts/tracetool/vcpu.py
>
> IMHO the '#!/usr/bin/env' header should only be added to files
> which are executable scripts - ie a main() method. IOW, it
> ought to be removed from all these tracetool modules.
I agree.
Typically any Python source file that does not have "if __name__ ==
'__main__':" is just a module and not an executable script. That is a
good heuristic for identifying files that shouldn't have the hashbang
header, but manual review is still necessary in case one of the files is
doing something unusual.
Stefan
signature.asc
Description: PGP signature