Skip to content

Commit

Permalink
Fix print_stack_entry for celery
Browse files Browse the repository at this point in the history
  • Loading branch information
cansarigol committed Jan 27, 2023
1 parent 05aa637 commit ffd9e3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions pdbr/_pdbr.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,22 +419,20 @@ def _print_layout(self, val, **kwargs):
)

def print_stack_entry(self, frame_lineno, prompt_prefix="\n-> ", context=None):
def print_syntax(*args):
# Remove color format.
if base == Pdb or is_celery:
Pdb.print_stack_entry(self, frame_lineno, prompt_prefix)
else:
self._print(
Syntax(
ANSI_ESCAPE.sub("", self.format_stack_entry(*args)),
ANSI_ESCAPE.sub(
"", self.format_stack_entry(frame_lineno, "", context)
),
"python",
theme=self._theme or DEFAULT_THEME,
),
print_layout=False,
)

if base == Pdb or is_celery:
print_syntax(frame_lineno, prompt_prefix)
else:
print_syntax(frame_lineno, "", context)

# vds: >>
frame, lineno = frame_lineno
filename = frame.f_code.co_filename
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pdbr"
version = "0.7.8"
version = "0.8.0"
description = "Pdb with Rich library."
authors = ["Can Sarigol <ertugrulsarigol@gmail.com>"]
packages = [
Expand Down Expand Up @@ -55,7 +55,7 @@ verbose = false

[project]
name = "pdbr"
version = "0.7.8"
version = "0.8.0"

[tool.setuptools]
py-modules = []

0 comments on commit ffd9e3c

Please sign in to comment.