Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 17bfa20

Browse files
authored
Merge pull request #32 from juanjux/fix/propagate_errors
Return more concrete AST parsing errors
2 parents 96b24d3 + 6151479 commit 17bfa20

File tree

6 files changed

+11
-26
lines changed

6 files changed

+11
-26
lines changed

Dockerfile.build.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ RUN mkdir -p /opt/driver/src && \
44
adduser $BUILD_USER -u $BUILD_UID -D -h /opt/driver/src
55

66
RUN apk add --no-cache --update python python-dev python3 python3-dev py-pip py2-pip git build-base bash
7-
RUN pip3 install six pydetector==0.5.7 \
7+
RUN pip3 install six pydetector==0.6.1 \
88
git+https://github.com/python/mypy.git@0bb2d1680e8b9522108b38d203cb73021a617e64#egg=mypy-lang
9-
RUN pip2 install six pydetector==0.5.7
9+
RUN pip2 install six pydetector==0.6.1
1010

1111
WORKDIR /opt/driver/src

Dockerfile.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FROM alpine:3.6
22
MAINTAINER source{d}
33

44
RUN apk add --no-cache --update python python3 py-pip py2-pip git
5-
RUN pip3 install six pydetector==0.5.7
6-
RUN pip2 install six pydetector==0.5.7
5+
RUN pip3 install six pydetector==0.6.1
6+
RUN pip2 install six pydetector==0.6.1
77

88
ADD build /opt/driver/bin
99
ADD native/python_package /tmp/python_driver

native/python_package/python_driver/requestprocessor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ def process_request(self, request: RawRequest) -> None:
133133
elif version in (1, 2) and codeinfo['py2ast']:
134134
ast = codeinfo['py2ast']
135135
else:
136-
raise Exception('Could not determine Python version')
136+
raise Exception(
137+
'Errors produced trying to get an AST for both Python versions' +
138+
'\n------ Python2 errors:\n%s' % codeinfo['py2_ast_errors'] +
139+
'\n------ Python3 errors:\n%s' % codeinfo['py3_ast_errors']
140+
)
137141

138142
if not ast:
139143
raise Exception('Empty AST generated from non empty code')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
msgpack-python==0.4.8
2-
pydetector==0.5.7
2+
pydetector==0.6.1
33
-e git+git://github.com/python/mypy.git@0bb2d1680e8b9522108b38d203cb73021a617e64#egg=mypy-lang
44
typed-ast==1.0.1

native/python_package/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
install_requires=[
3434
"msgpack-python==0.4.8",
35-
"pydetector==0.5.7"
35+
"pydetector==0.6.1"
3636
],
3737
classifiers=[
3838
"Development Status :: 4 - Beta",

native/python_package/test/sendmsg.nim

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)