mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
bpo-29637: clean docstring only if not None (GH-267)
This commit is contained in:
parent
357bad7101
commit
41cea70aa3
2 changed files with 5 additions and 1 deletions
|
@ -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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue