Skip to content

Commit 84cbc07

Browse files
authored
Convert '$' in method name to '_' (#616)
1 parent 46164b9 commit 84cbc07

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

googleapiclient/discovery.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,16 @@ class _BytesGenerator(BytesGenerator):
126126
_write_lines = BytesGenerator.write
127127

128128
def fix_method_name(name):
129-
"""Fix method names to avoid reserved word conflicts.
129+
"""Fix method names to avoid '$' characters and reserved word conflicts.
130130
131131
Args:
132132
name: string, method name.
133133
134134
Returns:
135-
The name with an '_' appended if the name is a reserved word.
135+
The name with '_' appended if the name is a reserved word and '$'
136+
replaced with '_'.
136137
"""
138+
name = name.replace('$', '_')
137139
if keyword.iskeyword(name) or name in RESERVED_WORDS:
138140
return name + '_'
139141
else:

0 commit comments

Comments
 (0)