File: 04_fix-python3-sintax-error.patch

package info (click to toggle)
circuits 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,384 kB
  • ctags: 3,037
  • sloc: python: 14,416; makefile: 146; sh: 61
file content (27 lines) | stat: -rw-r--r-- 1,006 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
Description: Fix sintax errors since print and exec are not keywords in Python3
Author: Daniele Tricoli <eriol@mornie.org>
--- a/circuits/web/apps/memorymonitor/reftree.py
+++ b/circuits/web/apps/memorymonitor/reftree.py
@@ -172,9 +172,9 @@
         """Walk the object tree, pretty-printing each branch."""
         self.ignore_caller()
         for trail in self.walk(maxresults, maxdepth):
-            print trail
+            print (trail)
         if self.stops:
-            print "%s paths stopped because max depth reached" % self.stops
+            print ("%s paths stopped because max depth reached" % self.stops)


 def count_objects():
--- a/circuits/web/apps/webconsole/__init__.py
+++ b/circuits/web/apps/webconsole/__init__.py
@@ -56,7 +56,7 @@
         sys.stdout = sys.stderr = out
         try:
             try:
-                exec code in self.locals
+                exec (code in self.locals)
             except:
                 result = traceback.format_exc()
             else: