File: printer.py.patch

package info (click to toggle)
sympy 1.14.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 36,944 kB
  • sloc: python: 460,603; xml: 359; makefile: 162; sh: 59; lisp: 4
file content (30 lines) | stat: -rw-r--r-- 993 bytes parent folder | download
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)