Skip to content

Commit

Permalink
gyp: make cmake python3 compatible
Browse files Browse the repository at this point in the history
PR-URL: #1944
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
gengjiawen authored and rvagg committed Oct 30, 2019
1 parent 9c0f340 commit d8e09a1
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 d8e09a1

Please sign in to comment.