aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lynn Wu <jameslynnwu@users.noreply.github.com>2020-04-20 13:43:18 -0400
committerGitHub <noreply@github.com>2020-04-20 13:43:18 -0400
commita077a2faf3d0420fac0945c88e0628188d2c8674 (patch)
tree1ea8b509be164d34f29580f54aa7da1e26ccceb7
parent1f48dc05900b7d8c5f5157358e3c334d0566c7c1 (diff)
downloadapitools-a077a2faf3d0420fac0945c88e0628188d2c8674.tar.gz
Update util.py
Include exec as a keyword. exec is no longer a keyword. https://docs.python.org/3/whatsnew/3.0.html#removed-syntax
-rw-r--r--apitools/gen/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/apitools/gen/util.py b/apitools/gen/util.py
index 2dbf25e..7cf2902 100644
--- a/apitools/gen/util.py
+++ b/apitools/gen/util.py
@@ -93,7 +93,7 @@ class Names(object):
name = re.sub('[^_A-Za-z0-9]', '_', name)
if name[0].isdigit():
name = '_%s' % name
- while keyword.iskeyword(name):
+ while keyword.iskeyword(name) or name is 'exec':
name = '%s_' % name
# If we end up with __ as a prefix, we'll run afoul of python
# field renaming, so we manually correct for it.