summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorMatthias Bussonnier <bussonniermatthias@gmail.com>2017-02-24 06:44:19 (GMT)
committerINADA Naoki <methane@users.noreply.github.com>2017-02-24 06:44:19 (GMT)
commit41cea70aa38de50c1d714209aa2b7694d86a7e0c (patch)
tree827564c200fe9efdb2fc2545e912018c311a378f /Lib/test/test_ast.py
parent357bad7101df196d7f4ea3dc6ed9a6436afb022c (diff)
downloadcpython-41cea70aa38de50c1d714209aa2b7694d86a7e0c.zip
cpython-41cea70aa38de50c1d714209aa2b7694d86a7e0c.tar.gz
cpython-41cea70aa38de50c1d714209aa2b7694d86a7e0c.tar.bz2
bpo-29637: clean docstring only if not None (GH-267)
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 366269f..2f59527 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -532,6 +532,7 @@ class ASTHelpers_Test(unittest.TestCase):
node = ast.parse('async def foo():\n """spam\n ham"""')
self.assertEqual(ast.get_docstring(node.body[0]), 'spam\nham')
+ self.assertIsNone(ast.get_docstring(ast.parse('')))
def test_literal_eval(self):
self.assertEqual(ast.literal_eval('[1, 2, 3]'), [1, 2, 3])