Skip to content

Commit

Permalink
Merge pull request #14 from nndii/fix/closed_stdin
Browse files Browse the repository at this point in the history
Fix reading from a closed stdin buffer
  • Loading branch information
tylerwince authored Oct 8, 2019
2 parents cd579bd + f0fe747 commit 849c545
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions flake8_bandit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
except ImportError:
import ConfigParser as configparser

try:
from flake8.engine import pep8 as stdin_utils
except ImportError:
from flake8 import utils as stdin_utils


__version__ = "2.1.1"
__version__ = "2.1.2"


class BanditTester(object):
Expand Down Expand Up @@ -90,7 +95,7 @@ def _load_source(self):

if self.filename in ("stdin", "-", None):
self.filename = "stdin"
self.lines = pycodestyle.stdin_get_value().splitlines(True)
self.lines = stdin_utils.stdin_get_value().splitlines(True)
else:
self.lines = pycodestyle.readlines(self.filename)
if not self.tree:
Expand Down

0 comments on commit 849c545

Please sign in to comment.