Skip to content

Commit

Permalink
Drop Python 2 workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
roehling committed Sep 20, 2024
1 parent 4351b1b commit 0d423df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
12 changes: 2 additions & 10 deletions src/catkin_lint/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ def word_split(s):
return result


try:
from itertools import zip_longest
except ImportError:
def zip_longest(*args):
return map(None, *args)
from itertools import zip_longest # noqa


def write_atomic(filepath, data):
Expand Down Expand Up @@ -123,8 +119,4 @@ def enumerate_package_files(rootdir, catkin_ignore=True, ignore_dot=True, ignore
yield dirpath, filename


# Python 3 compatibility without sacrificing the speed gain of iteritems in Python 2
try:
iteritems = dict.iteritems
except AttributeError:
iteritems = dict.items
iteritems = dict.items
5 changes: 1 addition & 4 deletions test/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
from unittest import skip

import os
try:
from unittest.mock import patch, mock_open, DEFAULT # noqa
except ImportError:
from mock import patch, mock_open, DEFAULT # noqa
from unittest.mock import patch, mock_open, DEFAULT # noqa

import posixpath
import ntpath
Expand Down

0 comments on commit 0d423df

Please sign in to comment.