Skip to content

Commit 7ab9efd

Browse files
gh-113299: Move cpp.py into libclinic (#113526)
1 parent 87295b4 commit 7ab9efd

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Lib/test/test_clinic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3920,7 +3920,7 @@ def test_Function_and_Parameter_reprs(self):
39203920
self.assertEqual(repr(parameter), "<clinic.Parameter 'bar'>")
39213921

39223922
def test_Monitor_repr(self):
3923-
monitor = clinic.cpp.Monitor("test.c")
3923+
monitor = libclinic.cpp.Monitor("test.c")
39243924
self.assertRegex(repr(monitor), r"<clinic.Monitor \d+ line=0 condition=''>")
39253925

39263926
monitor.line_number = 42

Tools/clinic/clinic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import collections
1414
import contextlib
1515
import copy
16-
import cpp
1716
import dataclasses as dc
1817
import enum
1918
import functools
@@ -53,6 +52,7 @@
5352

5453
# Local imports.
5554
import libclinic
55+
import libclinic.cpp
5656
from libclinic import ClinicError
5757

5858

@@ -648,7 +648,7 @@ class CLanguage(Language):
648648

649649
def __init__(self, filename: str) -> None:
650650
super().__init__(filename)
651-
self.cpp = cpp.Monitor(filename)
651+
self.cpp = libclinic.cpp.Monitor(filename)
652652

653653
def parse_line(self, line: str) -> None:
654654
self.cpp.writeline(line)

Tools/clinic/cpp.py renamed to Tools/clinic/libclinic/cpp.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
import sys
44
from typing import NoReturn
55

6-
from libclinic.errors import ParseError
6+
from .errors import ParseError
7+
8+
9+
__all__ = ["Monitor"]
710

811

912
TokenAndCondition = tuple[str, str]

0 commit comments

Comments
 (0)