File: use-python3.patch

package info (click to toggle)
ruby-github-markup 1.7.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 420 kB
  • sloc: ruby: 441; python: 167; sh: 26; makefile: 18; perl: 12
file content (34 lines) | stat: -rw-r--r-- 881 bytes parent folder | download | duplicates (3)
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
31
32
33
34
Switch to python3

--- a/lib/github/commands/rest2html
+++ b/lib/github/commands/rest2html
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """
 rest2html - A small wrapper file for parsing ReST files at GitHub.
 
@@ -30,12 +30,6 @@
 import sys
 import os
 
-# This fixes docutils failing with unicode parameters to CSV-Table. The -S
-# switch and the following 3 lines can be removed after upgrading to python 3.
-if sys.version_info[0] < 3:
-    reload(sys)
-    sys.setdefaultencoding('utf-8')
-
 import site
 
 try:
--- a/lib/github/markups.rb
+++ b/lib/github/markups.rb
@@ -45,7 +45,7 @@
 
 command(
   ::GitHub::Markups::MARKUP_RST,
-  "python2 -S #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html",
+  "python3 #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html",
   /re?st(\.txt)?/,
   ["reStructuredText"],
   "restructuredtext"