Fix bug in 3.8 with .. as

This commit is contained in:
rocky
2020-06-04 05:24:22 -04:00
parent 40a653cd3b
commit 9acb3cf068
10 changed files with 60 additions and 29 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -2,6 +2,7 @@
# Bug was code not knowing which Python versions
# have kwargs coming before positional args in code.
"""This program is self-checking!"""
# RUNNABLE!
def tometadata(self, metadata, schema, Table, args, name=None):

View File

@@ -16,3 +16,11 @@ def withas_bug(self, nested, a, b):
with self.assertRaises(ZeroDivisionError):
with nested(a(), b()) as (x, y):
1 // 0
# Adapted from 3.8 distutils/command/config.py
# In 3.8 the problem was in handling "with .. as" code
def _gen_temp_sourcefile(x, a, headers, lang):
with x as y:
if a:
y = 2
return 5