Skip to content

fix(SU2_PY): replace Python 2 string.join() with str.join() in polarSweepLib.py#2760

Merged
pcarruscag merged 2 commits intosu2code:developfrom
riddhi1228:fix/polarSweepLib-string-join
Mar 21, 2026
Merged

fix(SU2_PY): replace Python 2 string.join() with str.join() in polarSweepLib.py#2760
pcarruscag merged 2 commits intosu2code:developfrom
riddhi1228:fix/polarSweepLib-string-join

Conversation

@riddhi1228
Copy link

@riddhi1228 riddhi1228 commented Mar 19, 2026

Proposed Changes

string.join() was removed in Python 3, causing an immediateAttributeError: module 'string' has no attribute 'join' when running polar sweep analysis on any modern Python installation. Replaces string.join(x.split(), "") with "".join(x.split()) — identical behavior, Python 3 compatible. Also removes the now-unused import string statement.

Related Work

Part of the Python 3 modernization of SU2_PY scripts (see PR #2758).

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings.
  • My contribution is commented and consistent with SU2 style.
  • I used the pre-commit hook to prevent dirty commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation, if necessary.

…weepLib.py

string.join() was removed in Python 3. Replace with the equivalent
''.join() syntax. Also removes the now-unused 'import string' statement.

Fixes AttributeError: module 'string' has no attribute 'join' when
running polar sweep analysis on Python 3.
@pcarruscag pcarruscag merged commit b1fb53d into su2code:develop Mar 21, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants