Avoid KeyError on Python 3 when BEAM_EXPERIMENTAL_PY3 is not defined.
diff --git a/sdks/python/apache_beam/__init__.py b/sdks/python/apache_beam/__init__.py
index 569d6c4..ce8bdc2 100644
--- a/sdks/python/apache_beam/__init__.py
+++ b/sdks/python/apache_beam/__init__.py
@@ -79,7 +79,8 @@
if not ((sys.version_info[0] == 2 and sys.version_info[1] == 7) or
- (sys.version_info[0] == 3 and os.environ['BEAM_EXPERIMENTAL_PY3'])):
+ (sys.version_info[0] == 3 and
+ os.environ.get('BEAM_EXPERIMENTAL_PY3', False))):
raise RuntimeError(
'The Apache Beam SDK for Python is supported only on Python 2.7. '
'It is not supported on Python ['+ str(sys.version_info) + '].')