aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBu Sun Kim <8822365+busunkim96@users.noreply.github.com>2019-01-25 15:49:52 -0800
committerGitHub <noreply@github.com>2019-01-25 15:49:52 -0800
commit84cbc07ca4349b2b52f210c8c6f861dd1b178d21 (patch)
treed70e6a9d953c7f782f89e9a1b203a9510a44bbbc
parent46164b97e3ed014b0370a35386764ec6c2607501 (diff)
downloadgoogle-api-python-client-84cbc07ca4349b2b52f210c8c6f861dd1b178d21.tar.gz
Convert '$' in method name to '_' (#616)
-rw-r--r--googleapiclient/discovery.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/googleapiclient/discovery.py b/googleapiclient/discovery.py
index e86a297f1..7d895bbed 100644
--- a/googleapiclient/discovery.py
+++ b/googleapiclient/discovery.py
@@ -126,14 +126,16 @@ class _BytesGenerator(BytesGenerator):
_write_lines = BytesGenerator.write
def fix_method_name(name):
- """Fix method names to avoid reserved word conflicts.
+ """Fix method names to avoid '$' characters and reserved word conflicts.
Args:
name: string, method name.
Returns:
- The name with an '_' appended if the name is a reserved word.
+ The name with '_' appended if the name is a reserved word and '$'
+ replaced with '_'.
"""
+ name = name.replace('$', '_')
if keyword.iskeyword(name) or name in RESERVED_WORDS:
return name + '_'
else: