Skip to content

Commit 88b0275

Browse files
authored
Remove the _pyast shim (#750)
Fixes #749
1 parent 8545148 commit 88b0275

File tree

7 files changed

+19
-286
lines changed

7 files changed

+19
-286
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3434
### Removed
3535
* Removed the dependency `astor` for versions of Python 3.9+ (#736)
3636
* Removed `basilisp.__version__` in favor of using `importlib.metadata` for version info (#617)
37+
* Removed a shim to Python's `ast` module to support compatibility with Python 3.6 and 3.7 (#749)
3738

3839
## [v0.1.0a2]
3940
### Added

src/basilisp/_pyast.py

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

src/basilisp/lang/compiler/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import ast
12
import itertools
23
import os
34
import sys
45
import types
56
from typing import Any, Callable, Iterable, List, Optional
67

7-
from basilisp import _pyast as ast
88
from basilisp.lang import map as lmap
99
from basilisp.lang import runtime as runtime
1010
from basilisp.lang.compiler.analyzer import ( # noqa
@@ -173,7 +173,7 @@ def compile_and_exec_form(
173173
)
174174
)
175175

176-
ast_module = ast.Module(body=form_ast)
176+
ast_module = ast.Module(body=form_ast, type_ignores=[])
177177
ast_module = ctx.py_ast_optimizer.visit(ast_module)
178178
ast.fix_missing_locations(ast_module)
179179

@@ -206,7 +206,7 @@ def _incremental_compile_module(
206206
map(_statementize, itertools.chain(py_ast.dependencies, [py_ast.node]))
207207
)
208208

209-
module = ast.Module(body=list(module_body))
209+
module = ast.Module(body=list(module_body), type_ignores=[])
210210
module = optimizer.visit(module)
211211
ast.fix_missing_locations(module)
212212

src/basilisp/lang/compiler/analyzer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,7 @@ def _inline_fn_ast(
20042004
macroed_form = reader.syntax_quote(unquoted_form)
20052005
inline_fn_form = llist.l(
20062006
SpecialForm.FN,
2007+
*([sym.symbol(genname(f"{name.name}-inline"))] if name is not None else []),
20072008
vec.vector(binding.form for binding in inline_arity.params),
20082009
macroed_form,
20092010
)

src/basilisp/lang/compiler/exception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import ast
12
from enum import Enum
23
from typing import Any, Dict, Optional, Union
34

45
import attr
56

6-
from basilisp import _pyast as ast
77
from basilisp.lang import keyword as kw
88
from basilisp.lang import map as lmap
99
from basilisp.lang.compiler.nodes import Node

0 commit comments

Comments
 (0)