Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-113299: Move cpp.py into libclinic #113526

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3920,7 +3920,7 @@ def test_Function_and_Parameter_reprs(self):
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
Expand Down
4 changes: 2 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import collections
import contextlib
import copy
import cpp
import dataclasses as dc
import enum
import functools
Expand Down Expand Up @@ -53,6 +52,7 @@

# Local imports.
import libclinic
import libclinic.cpp
from libclinic import ClinicError


Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion Tools/clinic/cpp.py → Tools/clinic/libclinic/cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import sys
from typing import NoReturn

from libclinic.errors import ParseError
from .errors import ParseError


__all__ = ["Monitor"]


TokenAndCondition = tuple[str, str]
Expand Down
Loading