Skip to content

Commit bb0ec1a

Browse files
committed
gh-113317: Remove Argument Clinic global variable 'clinic'
* Add Clinic.warn() and Clinic.fail() methods. * Add filename parameter to BlockParser constructor. * Add BlockParser.fail() method. * Add DSLParser.fail() method. * Pass lineno parameter to DSLParser.format_docstring(): more accurate error reporting. * Convert a few DSLParser static methods to regular method to be able to call self.fail(). * Language.render() clinic parameter is now required: None is no longer accepted. * Remove warn() function. * Remove global variable 'clinic'. fail() and warn() methods get filename and line number from the instance on which the method is called, rather than relying on a global variable 'clinic'.
1 parent e21754d commit bb0ec1a

File tree

2 files changed

+186
-171
lines changed

2 files changed

+186
-171
lines changed

Lib/test/test_clinic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,7 @@ def test_state_func_docstring_no_summary(self):
23902390
docstring1
23912391
docstring2
23922392
"""
2393-
self.expect_failure(block, err, lineno=0)
2393+
self.expect_failure(block, err, lineno=3)
23942394

23952395
def test_state_func_docstring_only_one_param_template(self):
23962396
err = "You may not specify {parameters} more than once in a docstring!"
@@ -2404,7 +2404,7 @@ def test_state_func_docstring_only_one_param_template(self):
24042404
these are the params again:
24052405
{parameters}
24062406
"""
2407-
self.expect_failure(block, err, lineno=0)
2407+
self.expect_failure(block, err, lineno=7)
24082408

24092409

24102410
class ClinicExternalTest(TestCase):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy