~dricottone/huttese-apk

ref: 9e45d4cc79d8427f70ac407b0dc2e9d7051f1367 huttese-apk/sr.ht/py-pygments/pr-779-python3-in-analyze_text.patch -rw-r--r-- 596 bytes
9e45d4cc — Drew DeVault Add zxcvbn to meta.sr.ht dependencies 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]