1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
From: Debian Science Maintainers
<debian-science-maintainers@lists.alioth.debian.org>
Date: Wed, 25 Mar 2026 15:01:58 +0100
Subject: printer.py
define a __globals__ attribute in wrapper _PrintFunction
to close Debian bug #980707
---
sympy/printing/printer.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sympy/printing/printer.py b/sympy/printing/printer.py
index 0c0a697..87507ec 100644
--- a/sympy/printing/printer.py
+++ b/sympy/printing/printer.py
@@ -395,6 +395,14 @@ def __init__(self, f, print_cls: Type[Printer]):
assert params.pop(-1).kind == inspect.Parameter.VAR_KEYWORD
self.__other_params = params
+ # define the __globals__ attribute to fix Debian bug #980707
+ # which touches the package octave-symbolic
+ #
+ if hasattr(f, "__globals__"):
+ self.__globals__ = f.__globals__
+ else:
+ self.__globals__ = []
+
self.__print_cls = print_cls
update_wrapper(self, f)
|