Skip to content

Commit

Permalink
pythongh-113299: Move cpp.py into libclinic (python#113526)
Browse files Browse the repository at this point in the history
  • Loading branch information
erlend-aasland authored and kulikjak committed Jan 22, 2024
1 parent 838a896 commit 9c60bbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
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

0 comments on commit 9c60bbd

Please sign in to comment.