summaryrefslogtreecommitdiff
path: root/astroid/rebuilder.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-07-07 09:02:47 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2019-07-07 09:02:47 +0300
commit55a05c73f164af373640800ec266f38a38fc9d58 (patch)
tree60e3d1e47b8b848b341df926959063a75ffc6fe2 /astroid/rebuilder.py
parenta354ae3d9cc7be5509cccf4b1b50c8846c94d8de (diff)
downloadastroid-git-55a05c73f164af373640800ec266f38a38fc9d58.tar.gz
Grab the Constant value on Python 3.8+
Diffstat (limited to 'astroid/rebuilder.py')
-rw-r--r--astroid/rebuilder.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py
index 205dd47a..a3e1f243 100644
--- a/astroid/rebuilder.py
+++ b/astroid/rebuilder.py
@@ -134,7 +134,8 @@ class TreeRebuilder:
first_value = node.body[0].value
if isinstance(first_value, self._parser_module.Str) or (
- isinstance(first_value, self._parser_module.Constant)
+ PY38
+ and isinstance(first_value, self._parser_module.Constant)
and isinstance(first_value.value, str)
):
doc = first_value.value if PY38 else first_value.s