Skip to content

don't use local variable 'pylibdir' in list comprehension in PyQt easyconfig, since that doesn't work in Python 3#7848

Merged
akesandgren merged 1 commit intoeasybuilders:developfrom
boegel:fix_PyQt_py3
Mar 9, 2019
Merged

don't use local variable 'pylibdir' in list comprehension in PyQt easyconfig, since that doesn't work in Python 3#7848
akesandgren merged 1 commit intoeasybuilders:developfrom
boegel:fix_PyQt_py3

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Mar 9, 2019

Parsing PyQt-4.12.3-fosscuda-2018b-Python-2.7.15.eb on top of Python 3 (using the 4.x branches) fails with:

  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/easybuild_framework-3.9.0.dev0-py3.6.egg/easybuild/framework/easyconfig/format/pyheaderconfigobj.py", line 187, in parse_pyheader
    exec(pyheader, global_vars, local_vars)
  File "<string>", line 60, in <module>
  File "<string>", line 60, in <listcomp>
NameError: name 'pylibdir' is not defined

This issue is similar to the one we danced around with #7797.

The underlying issue is probably that list comprehensions have their own scope in Python 3, see also https://portingguide.readthedocs.io/en/latest/comprehensions.html .

Another way to fix this is to declare pylibdir as global in the easyconfig, but I'd like to avoid that...

…yconfig, since that doesn't work in Python 3
@boegel boegel added change python3 Python 3 compatibility labels Mar 9, 2019
@boegel boegel added this to the next release (3.8.2) milestone Mar 9, 2019
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Mar 9, 2019

Test report by @boegel
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in this PR)
node2402.golett.os - Linux centos linux 7.6.1810, Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz, Python 2.7.5
See https://gist.github.com/bba16351f8924788b68202d5f59e8e09 for a full test report.

Copy link
Copy Markdown
Contributor

@akesandgren akesandgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akesandgren
Copy link
Copy Markdown
Contributor

Test report by @akesandgren
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in this PR)
b-an03.hpc2n.umu.se - Linux ubuntu 16.04, Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz, Python 2.7.12
See https://gist.github.com/bf1c88760eebc46efd3b5bf2333f6796 for a full test report.

@akesandgren
Copy link
Copy Markdown
Contributor

Going in, thanks @boegel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change python3 Python 3 compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants