From 6162dba23403adc820c308a2dc360bfe46ecf388 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Mon, 28 Oct 2019 20:39:01 +0800 Subject: [PATCH] gyp: make cmake python3 compatible --- gyp/pylib/gyp/generator/cmake.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gyp/pylib/gyp/generator/cmake.py b/gyp/pylib/gyp/generator/cmake.py index 996b6f25fd..5601a6657e 100644 --- a/gyp/pylib/gyp/generator/cmake.py +++ b/gyp/pylib/gyp/generator/cmake.py @@ -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,