Skip to content

Commit

Permalink
Adds Python3.8 support, closes #109
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Mar 12, 2020
1 parent 5ec912d commit 2d075e4
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 146 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dist: xenial
python:
- 3.6
- 3.7
- 3.8

before_install:
- pip freeze | xargs pip uninstall -y
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
We follow Semantic Versions since the `0.1.0` release.


## 0.3.0

### Features

- Adds `python3.8` support


## 0.2.4

### Bugfixes
Expand Down
14 changes: 8 additions & 6 deletions flake8_eradicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from eradicate import filter_commented_out_code
from flake8.options.manager import OptionManager

#: This is a name that we use to install this library:
pkg_name = 'flake8-eradicate'

#: We store the version number inside the `pyproject.toml`:
Expand Down Expand Up @@ -93,14 +94,15 @@ def _contains_commented_out_code(self) -> bool:
when the tokens indicate a comment in the physical line.
"""
comment_in_line = False
for token_type, _, _, _, _ in self._tokens:
if token_type == tokenize.COMMENT:
comment_in_line = True
break
comment_in_line = any(
token_type == tokenize.COMMENT
for token_type, _, _, _, _ in self._tokens
)

if comment_in_line:
filtered_source = ''.join(filter_commented_out_code(
self._physical_line, self._options,
self._physical_line,
self._options,
))
return self._physical_line != filtered_source
return False
Loading

0 comments on commit 2d075e4

Please sign in to comment.