Skip to content

Commit

Permalink
Fix reading from closed stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
nndii committed Sep 24, 2019
1 parent cd579bd commit f0fe747
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 f0fe747

Please sign in to comment.