File: python3_shebangs.patch

package info (click to toggle)
statsmodels 0.14.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,940 kB
  • sloc: python: 253,284; f90: 612; sh: 560; javascript: 337; asm: 156; makefile: 145; ansic: 16; xml: 9
file content (65 lines) | stat: -rw-r--r-- 1,870 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Description: Use Python 3 in script shebangs

(Skipping the two .pyx files with #!python - they need to be compiled
with Cython, not directly run with any version of plain Python)

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

--- a/archive/docs/fix_longtable.py
+++ b/archive/docs/fix_longtable.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import sys
 import os
 
--- a/statsmodels/regression/quantile_regression.py
+++ b/statsmodels/regression/quantile_regression.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 '''
 Quantile regression model
--- a/statsmodels/sandbox/examples/example_pca.py
+++ b/statsmodels/sandbox/examples/example_pca.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import numpy as np
 from statsmodels.sandbox.pca import Pca
--- a/statsmodels/tools/print_version.py
+++ b/statsmodels/tools/print_version.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from functools import reduce
 import sys
 from os.path import dirname
--- a/tools/export_notebooks_to_python.py
+++ b/tools/export_notebooks_to_python.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import argparse
 import glob
 import logging
@@ -134,6 +134,8 @@ def main():
                     continue
                 elif block.startswith("# In[ ]:"):
                     continue
+                if block == "#!/usr/bin/env python":
+                    block = "#!/usr/bin/env python3"
                 if block.startswith("#"):
                     # Wrap comments from Markdown
                     block = textwrap.fill(block, width=74)
--- a/tools/generate_formula_api.py
+++ b/tools/generate_formula_api.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """
 This will generate an API file for formula in dir/statsmodels/formula/api.py