Skip to content

Commit 0f6fec5

Browse files
committed
Clean up code
1 parent 0be05eb commit 0f6fec5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

shellwhat/parsers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class OshParser(AstModule):
2323
def parse(cls, code, strict=True):
2424
try:
2525
res = check_output(
26-
PARSER_OSH_STUB + [code], env=dict(os.environ, PYENV_VERSION="2.7.10", PYTHONPATH=getattr(cls, "PYTHONPATH", None))
26+
PARSER_OSH_STUB + [code],
27+
env=dict(os.environ, PYENV_VERSION="2.7.10", PYTHONPATH=PYTHONPATH),
2728
)
2829
ast_dict = json.loads(res.decode())
2930
if ast_dict is None:
@@ -65,7 +66,7 @@ def parse(cls, *args, **kwargs):
6566
# Determine which parser to use and how it is called.
6667
# By default, the DummyParser is used.
6768
parse_opt = os.environ.get("SHELLWHAT_PARSER", "osh")
68-
setattr(OshParser, "PYTHONPATH", "/var/lib/python/site-packages/python2")
69+
PYTHONPATH = "/var/lib/python/site-packages/python2"
6970
if parse_opt == "osh":
7071
DEFAULT_PARSER = OshParser
7172
PARSER_OSH_STUB = ["python2", "-m", "osh"]

0 commit comments

Comments
 (0)