~dricottone/huttese-apk

ref: 97be54404767b424ee796ad8bbdb956411915f56 huttese-apk/sr.ht/py-pygments/pr-779-python3-in-analyze_text.patch -rw-r--r-- 596 bytes
97be5440 — Drew DeVault mercurial: update to 4.9.1 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# HG changeset patch
# User Drew DeVault <sir@cmpwn.com>
# Date 1537640646 14400
# Node ID 6ce1e62557062395358f1934e38bb62078aa13a5
# Parent  7941677dc77d4f2bf0bbd6140ade85a9454b8b80
Support /usr/bin/env python3 in analyze_text

diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py
--- a/pygments/lexers/python.py
+++ b/pygments/lexers/python.py
@@ -238,7 +238,7 @@
     }
 
     def analyse_text(text):
-        return shebang_matches(text, r'pythonw?(2(\.\d)?)?') or \
+        return shebang_matches(text, r'pythonw?(2|3(\.\d)?)?') or \
             'import ' in text[:1000]