-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7766 from madhavajay/madhava/fix_ci_cd
Upgrade FastAPI and Starlette due to security fix
- Loading branch information
Showing
6 changed files
with
31 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,7 @@ | ||
# stdlib | ||
import _ast | ||
import ast | ||
import sys | ||
|
||
# third party | ||
import astunparse # ast.unparse for python 3.8 | ||
from six.moves import cStringIO | ||
|
||
# ast.unparse is only in >= python 3.9 | ||
# astunparse works on python 3.8 but has a bug caused by | ||
# the ast library in python 3.8 where Constant's dont have a default .kind attribute | ||
|
||
# this fixes the bug in ast.unparse https://github.com/IBM/lale/pull/738/files | ||
|
||
|
||
class FixUnparser(astunparse.Unparser): | ||
def _Constant(self, t: _ast.expr) -> None: | ||
if not hasattr(t, "kind"): | ||
t.kind = None | ||
|
||
super()._Constant(t) | ||
|
||
|
||
def unparse(tree: _ast.Module) -> str: | ||
if sys.version_info >= (3, 9): | ||
return ast.unparse(tree) | ||
else: | ||
v = cStringIO() | ||
FixUnparser(tree, file=v) | ||
return v.getvalue() | ||
return ast.unparse(tree) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters