File: printer.py.patch

package info (click to toggle)
sympy 1.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 36,784 kB
  • sloc: python: 460,598; xml: 359; makefile: 162; sh: 59; lisp: 4
file content (21 lines) | stat: -rw-r--r-- 765 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
define a __globals__ attribute in wrapper _PrintFunction
to close Debian bug #980707
Index: sympy/sympy/printing/printer.py
===================================================================
--- sympy.orig/sympy/printing/printer.py
+++ sympy/sympy/printing/printer.py
@@ -395,6 +395,14 @@ class _PrintFunction:
         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)