~dricottone/huttese-apk

ref: 20bc2137d30af6f0b3112fd6a94fab1181b722a6 huttese-apk/sr.ht/py-pygments/pr-779-python3-in-analyze_text.patch -rw-r--r-- 596 bytes
20bc2137 — Drew DeVault Add core.sr.ht migrations to dispatch.sr.ht 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]