mirror of https://github.com/python/cpython
gh-113299: Move cpp.py into libclinic (#113526)
This commit is contained in:
parent
87295b4068
commit
7ab9efdd6a
|
@ -3920,7 +3920,7 @@ class ClinicReprTests(unittest.TestCase):
|
|||
self.assertEqual(repr(parameter), "<clinic.Parameter 'bar'>")
|
||||
|
||||
def test_Monitor_repr(self):
|
||||
monitor = clinic.cpp.Monitor("test.c")
|
||||
monitor = libclinic.cpp.Monitor("test.c")
|
||||
self.assertRegex(repr(monitor), r"<clinic.Monitor \d+ line=0 condition=''>")
|
||||
|
||||
monitor.line_number = 42
|
||||
|
|
|
@ -13,7 +13,6 @@ import builtins as bltns
|
|||
import collections
|
||||
import contextlib
|
||||
import copy
|
||||
import cpp
|
||||
import dataclasses as dc
|
||||
import enum
|
||||
import functools
|
||||
|
@ -53,6 +52,7 @@ from typing import (
|
|||
|
||||
# Local imports.
|
||||
import libclinic
|
||||
import libclinic.cpp
|
||||
from libclinic import ClinicError
|
||||
|
||||
|
||||
|
@ -648,7 +648,7 @@ class CLanguage(Language):
|
|||
|
||||
def __init__(self, filename: str) -> None:
|
||||
super().__init__(filename)
|
||||
self.cpp = cpp.Monitor(filename)
|
||||
self.cpp = libclinic.cpp.Monitor(filename)
|
||||
|
||||
def parse_line(self, line: str) -> None:
|
||||
self.cpp.writeline(line)
|
||||
|
|
|
@ -3,7 +3,10 @@ import re
|
|||
import sys
|
||||
from typing import NoReturn
|
||||
|
||||
from libclinic.errors import ParseError
|
||||
from .errors import ParseError
|
||||
|
||||
|
||||
__all__ = ["Monitor"]
|
||||
|
||||
|
||||
TokenAndCondition = tuple[str, str]
|
Loading…
Reference in New Issue