Show More
@@ -9,6 +9,17 b' import sys' | |||||
9 | if not hasattr(sys, 'version_info') or sys.version_info < (2, 4, 0, 'final'): |
|
9 | if not hasattr(sys, 'version_info') or sys.version_info < (2, 4, 0, 'final'): | |
10 | raise SystemExit("Mercurial requires Python 2.4 or later.") |
|
10 | raise SystemExit("Mercurial requires Python 2.4 or later.") | |
11 |
|
11 | |||
|
12 | if sys.version_info[0] >= 3: | |||
|
13 | def b(s): | |||
|
14 | '''A helper function to emulate 2.6+ bytes literals using string | |||
|
15 | literals.''' | |||
|
16 | return s.encode('latin1') | |||
|
17 | else: | |||
|
18 | def b(s): | |||
|
19 | '''A helper function to emulate 2.6+ bytes literals using string | |||
|
20 | literals.''' | |||
|
21 | return s | |||
|
22 | ||||
12 | # Solaris Python packaging brain damage |
|
23 | # Solaris Python packaging brain damage | |
13 | try: |
|
24 | try: | |
14 | import hashlib |
|
25 | import hashlib | |
@@ -114,8 +125,8 b' def runcmd(cmd, env):' | |||||
114 | # fine, we don't want to load it anyway. Python may warn about |
|
125 | # fine, we don't want to load it anyway. Python may warn about | |
115 | # a missing __init__.py in mercurial/locale, we also ignore that. |
|
126 | # a missing __init__.py in mercurial/locale, we also ignore that. | |
116 | err = [e for e in err.splitlines() |
|
127 | err = [e for e in err.splitlines() | |
117 | if not e.startswith('Not trusting file') \ |
|
128 | if not e.startswith(b('Not trusting file')) \ | |
118 | and not e.startswith('warning: Not importing')] |
|
129 | and not e.startswith(b('warning: Not importing'))] | |
119 | if err: |
|
130 | if err: | |
120 | return '' |
|
131 | return '' | |
121 | return out |
|
132 | return out |
General Comments 0
You need to be logged in to leave comments.
Login now