Skip to content
Snippets Groups Projects
Commit 19c70fbb authored by Andre Sailer's avatar Andre Sailer
Browse files

getPlatform: fix possibly using before assignment

parent 8da6f6f9
No related branches found
No related tags found
1 merge request!2254Fixes for new pylint version: getPlatform et al.
......@@ -13,15 +13,9 @@ import distro # replacement of platform.linux_distribution https://github.com/ni
arch = platform.machine()
system = platform.system()
flagarch = 0
flagcxx=0
#---Determine external architecture and extra options----------------
if os.getenv('ARCHITECTURE'):
architecture = os.getenv('ARCHITECTURE')
flagarch = 1
if os.getenv('CXXOPTIONS'):
cxxoptions = os.getenv('cxxoptions')
flagcxx = 1
architecture = os.getenv('ARCHITECTURE', None)
cxxoptions = os.getenv('cxxoptions', None)
#---Determine the OS and version--------------------------------------
if system == 'Darwin' :
if int(platform.mac_ver()[0].split('.')[0]) > 10 :
......@@ -107,11 +101,11 @@ if buildtype == 'Release' : bt = 'opt'
elif buildtype == 'Debug' : bt = 'dbg'
else : bt = 'unk'
if flagarch==1:
if architecture:
print('%s+%s-%s-%s-%s' % (arch, architecture, osvers, compiler, bt))
elif flagcxx==1:
elif cxxoptions:
print('%s+%s-%s-%s-%s' % (arch, cxxoptions, osvers, compiler, bt))
elif flagarch==1 and flagcxx==1:
elif architecture and cxxoptions: # we can never get here
print('%s+%s+%s-%s-%s-%s' % (arch, architecture, cxxoptions, osvers, compiler, bt))
else:
print('%s-%s-%s-%s' % (arch, osvers, compiler, bt))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment