Skip to content

Commit 424e1e0

Browse files
maciekrbJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Fixes python version flag & bad import in context manager (GoogleCloudPlatform#1368)
1 parent 5c23563 commit 424e1e0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

endpoints/bookstore-grpc/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ FROM gcr.io/google_appengine/python
55

66
# Create a virtualenv for dependencies. This isolates these packages from
77
# system-level packages.
8-
RUN virtualenv /env
8+
RUN virtualenv -p python3.6 /env
99

1010
# Setting these environment variables are the same as running
1111
# source /env/bin/activate.
12-
ENV VIRTUAL_ENV -p python3.5 /env
12+
ENV VIRTUAL_ENV /env
1313
ENV PATH /env/bin:$PATH
1414

1515
ADD . /bookstore/

endpoints/bookstore-grpc/status.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from contextlib import contextmanager
1616

17-
import status
17+
import grpc
1818

1919

2020
@contextmanager
@@ -23,6 +23,6 @@ def context(grpc_context):
2323
try:
2424
yield
2525
except KeyError as key_error:
26-
grpc_context.code(status.Code.NOT_FOUND)
26+
grpc_context.code(grpc.StatusCode.NOT_FOUND)
2727
grpc_context.details(
2828
'Unable to find the item keyed by {}'.format(key_error))

0 commit comments

Comments
 (0)