Skip to content

Commit

Permalink
Make cmake python3 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
gengjiawen committed Oct 27, 2019
1 parent ec4d403 commit 12fe565
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gyp/pylib/gyp/generator/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ def StringToCMakeTargetName(a):
Invalid for make: ':'
Invalid for unknown reasons but cause failures: '.'
"""
return a.translate(string.maketrans(' /():."', '_______'))
try:
return a.translate(str.maketrans(' /():."', '_______'))
except AttributeError:
return a.translate(string.maketrans(' /():."', '_______'))


def WriteActions(target_name, actions, extra_sources, extra_deps,
Expand Down

0 comments on commit 12fe565

Please sign in to comment.