Re: [libvirt PATCH 02/11] scripts: group-qemu-caps: store paths in helper variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/25/21 2:19 PM, Pavel Hrdina wrote:
> On Tue, Aug 24, 2021 at 04:25:05PM +0200, Ján Tomko wrote:
>> Avoid repetition and specifying the path to the header file twice.
>>
>> Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
>> ---
>>  scripts/group-qemu-caps.py | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py
>> index ec10f24384..bd22dd992a 100755
>> --- a/scripts/group-qemu-caps.py
>> +++ b/scripts/group-qemu-caps.py
>> @@ -133,12 +133,15 @@ args = parser.parse_args()
>>  
>>  errs = False
>>  
>> -capsflags = load_caps_flags(args.prefix + 'src/qemu/qemu_capabilities.h',
>> +header_path = args.prefix + 'src/qemu/qemu_capabilities.h'
>> +source_path = args.prefix + 'src/qemu/qemu_capabilities.c'
> 
> I know that it's preexisting but this is not recommended way how to
> concatenate two or more strings in python.
> 
> I would use
> 
>     os.path.join(args.prefix, 'src/qemu/qemu_capabilities.h')
> 
> instead, or even better:
> 
>     os.path.join(args.prefix, 'src', 'qemu', 'qemu_capabilities.h')

(another non-pythonist here)

Is it so that the path is constructed correctly on OSes which use
backslash instead of forward slash?

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux