Skip to content

Commit 48a8254

Browse files
committed
Avoid variable reuse to fix mypy error
mypy 0.782 flags the rpaths variable as it is reused for a different type. Introduce a new variable for the OrderedDict value.
1 parent 0c7444b commit 48a8254

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

auditwheel/repair.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ def is_valid_rpath(rpath: str) -> bool:
158158
rpaths = filter(is_valid_rpath, old_rpaths.split(':'))
159159
# Remove duplicates while preserving ordering
160160
# Fake an OrderedSet using OrderedDict
161-
rpaths = OrderedDict([(old_rpath, '') for old_rpath in rpaths])
162-
rpaths[rpath] = ''
161+
rpath_set = OrderedDict([(old_rpath, '') for old_rpath in rpaths])
162+
rpath_set[rpath] = ''
163163

164-
patcher.set_rpath(lib_name, ':'.join(rpaths))
164+
patcher.set_rpath(lib_name, ':'.join(rpath_set))
165165

166166

167167
def _is_valid_rpath(rpath: str,

0 commit comments

Comments
 (0)