Skip to content

Commit

Permalink
Officially drop python 2 support.
Browse files Browse the repository at this point in the history
No longer works with python 2 since commit 2e43813.

> TypeError: east_asian_width() argument 1 must be unicode, not str
  • Loading branch information
ymattw committed Jun 19, 2024
1 parent 7aee777 commit 2e78187
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Ydiff
Term based tool to view *colored*, *incremental* diff in a version controlled
workspace (supports Git, Mercurial, Perforce and Svn so far) or from stdin,
with *side by side* (similar to ``diff -y``) and *auto pager* support. Requires
python (>= 2.6.0) and ``less``.
python3 and ``less``.

.. image:: https://raw.github.com/ymattw/ydiff/gh-pages/img/default.png
:alt: default
Expand Down
14 changes: 4 additions & 10 deletions ydiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
Term based tool to view *colored*, *incremental* diff in a *Git/Mercurial/Svn*
workspace or from stdin, with *side by side* and *auto pager* support. Requires
python (>= 2.6.0) and ``less``.
python3 and ``less``.
"""

import difflib
Expand All @@ -28,14 +28,8 @@
'stdin, with side by side and auto pager support')
}

if sys.hexversion < 0x02060000:
raise SystemExit('*** Requires python >= 2.6.0') # pragma: no cover


try:
unicode
except NameError:
unicode = str
if sys.hexversion < 0x03000000:
raise SystemExit('*** Requires python >= 3.0.0') # pragma: no cover


class Color(object):
Expand Down Expand Up @@ -631,7 +625,7 @@ def check_command_status(arguments):

def decode(line):
"""Decode UTF-8 if necessary."""
if isinstance(line, unicode):
if isinstance(line, str):
return line

for encoding in ['utf-8', 'latin1']:
Expand Down

0 comments on commit 2e78187

Please sign in to comment.