Skip to content

Commit 9d51192

Browse files
authored
Merge pull request #150 from mhagger/python2-is-dead-long-live-python2
Mention python3 first, python2 second
2 parents 5de53a1 + 0fc5d66 commit 9d51192

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ Requirements
5959

6060
* A Python interpreter; either
6161

62+
* Python 3.x, version 3.3 or later.
63+
6264
* Python 2.x, version 2.6 or later. If you are using Python
6365
2.6.x, then you have to install the ``argparse`` module yourself,
6466
as it was only added to the standard library in Python 2.7.
6567

66-
* Python 3.x, version 3.3 or later.
67-
6868
* A recent version of Git.
6969

7070
Bash completion requires Git's completion being available.

gitimerge.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,21 +243,21 @@ def communicate(process, input=None):
243243
return (output, error)
244244

245245

246-
if sys.hexversion < 0x03000000:
247-
# In Python 2.x, os.environ keys and values must be byte
246+
if sys.hexversion >= 0x03000000:
247+
# In Python 3.x, os.environ keys and values must be unicode
248248
# strings:
249249
def env_encode(s):
250-
"""Encode unicode keys or values for use in os.environ."""
250+
"""Use unicode keys or values unchanged in os.environ."""
251251

252-
return s.encode(PREFERRED_ENCODING)
252+
return s
253253

254254
else:
255-
# In Python 3.x, os.environ keys and values must be unicode
255+
# In Python 2.x, os.environ keys and values must be byte
256256
# strings:
257257
def env_encode(s):
258-
"""Use unicode keys or values unchanged in os.environ."""
258+
"""Encode unicode keys or values for use in os.environ."""
259259

260-
return s
260+
return s.encode(PREFERRED_ENCODING)
261261

262262

263263
class UncleanWorkTreeError(Failure):

0 commit comments

Comments
 (0)