File: 0010-Add-support-for-python-3.patch

package info (click to toggle)
ruby-pygments.rb 1.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,008 kB
  • sloc: ansic: 1,869; ruby: 612; python: 518; makefile: 10; sh: 4
file content (30 lines) | stat: -rw-r--r-- 952 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: Ted Nyman <ted@ted.io>
Date: Fri, 7 Dec 2012 01:52:18 -0800
Subject: Add support for python 3

---
 lib/pygments/mentos.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pygments/mentos.py b/lib/pygments/mentos.py
index cf70b7b..002a6cb 100755
--- a/lib/pygments/mentos.py
+++ b/lib/pygments/mentos.py
@@ -28,7 +28,7 @@ def _convert_keys(dictionary):
     if not isinstance(dictionary, dict):
         return dictionary
     return dict((str(k), _convert_keys(v))
-        for k, v in dictionary.items())
+        for k, v in list(dictionary.items()))
 
 def _write_error(error):
     res = {"error": error}
@@ -42,7 +42,7 @@ def _write_error(error):
 
 def _get_fixed_bits_from_header(out_header):
     size = len(out_header)
-    return "".join(map(lambda y:str((size>>y)&1), range(32-1, -1, -1)))
+    return "".join([str((size>>y)&1) for y in range(32-1, -1, -1)])
 
 def _signal_handler(signal, frame):
     """