~dricottone/huttese-apk

ref: d56be4a168a343bd939aaf290e2cc852e13f9576 huttese-apk/sr.ht/py-pygments/pr-779-python3-in-analyze_text.patch -rw-r--r-- 596 bytes
d56be4a1 — Drew DeVault Handle Alpine release in pkgkit 5 years ago
                                                                                
8e65c17c Martijn Braam
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]