Skip to content

Commit 2786cbc

Browse files
authored
Merge pull request rocky#504 from rocky/TABLE_DIRECT-pollution
Don't update global tables, copy them instead.
2 parents 37f38e4 + 5c391f9 commit 2786cbc

File tree

10 files changed

+2
-14
lines changed

10 files changed

+2
-14
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
# Test
6565
# This would typically be a build job when using workflows, possibly combined with build
6666
# This is based on your 1.0 configuration file or project settings
67-
- run: sudo python ./setup.py develop && make check-3.6
67+
- run: sudo pip install -e . && make check-3.6
6868
- run: cd ./test/stdlib && bash ./runtests.sh 'test_[p-z]*.py'
6969
# Teardown
7070
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each

uncompyle6/semantics/customize.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030

3131
def customize_for_version(self, is_pypy, version):
32-
self.TABLE_DIRECT = TABLE_DIRECT.copy()
3332
if is_pypy:
3433
########################
3534
# PyPy changes
@@ -264,7 +263,6 @@ def n_call(node):
264263

265264
# < 3.0 continues
266265

267-
self.TABLE_R = TABLE_R.copy()
268266
self.TABLE_R.update(
269267
{
270268
"STORE_SLICE+0": ("%c[:]", 0),

uncompyle6/semantics/customize25.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def customize_for_version25(self, version):
2525
########################
2626
# Import style for 2.5+
2727
########################
28-
TABLE_DIRECT.update(
28+
self.TABLE_DIRECT.update(
2929
{
3030
"importmultiple": ("%|import %c%c\n", 2, 3),
3131
"import_cont": (", %c", 2),

uncompyle6/semantics/customize26_27.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020

2121
def customize_for_version26_27(self, version: tuple):
22-
self.TABLE_DIRECT = TABLE_DIRECT.copy()
2322
########################################
2423
# Python 2.6+
2524
# except <condition> as <var>

uncompyle6/semantics/customize3.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131

3232
def customize_for_version3(self, version: tuple):
33-
self.TABLE_DIRECT = TABLE_DIRECT.copy()
3433
self.TABLE_DIRECT.update(
3534
{
3635
"comp_for": (" for %c in %c", (2, "store"), (0, "expr")),

uncompyle6/semantics/customize35.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#######################
2727
def customize_for_version35(self, version: tuple):
2828
# fmt: off
29-
self.TABLE_DIRECT = TABLE_DIRECT.copy()
3029
self.TABLE_DIRECT.update(
3130
{
3231
# nested await expressions like:

uncompyle6/semantics/customize36.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def customize_for_version36(self, version: tuple):
9696
}
9797
)
9898

99-
self.TABLE_R = TABLE_R.copy()
10099
self.TABLE_R.update(
101100
{
102101
"CALL_FUNCTION_EX": ("%c(*%P)", 0, (1, 2, ", ", 100)),

uncompyle6/semantics/customize37.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ def customize_for_version37(self, version: tuple):
3030
# Python 3.7+ changes
3131
#######################
3232

33-
self.TABLE_DIRECT = TABLE_DIRECT.copy()
34-
3533
# fmt: off
3634
PRECEDENCE["attribute37"] = 2
3735
PRECEDENCE["call_ex"] = 1

uncompyle6/semantics/customize38.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ def customize_for_version38(self, version: tuple):
2929
# for lhs in 'for forelsestmt forelselaststmt '
3030
# 'forelselaststmtc tryfinally38'.split():
3131
# del TABLE_DIRECT[lhs]
32-
33-
self.TABLE_DIRECT = TABLE_DIRECT.copy()
3432
self.TABLE_DIRECT.update(
3533
{
3634
"async_for_stmt38": (

uncompyle6/semantics/fragments.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,6 @@ def comprehension_walk(self, node, iter_index, code_index=-5):
656656
code = Code(cn.attr, self.scanner, self.currentclass)
657657
ast = self.build_ast(code._tokens, code._customize, code)
658658

659-
self.TABLE_DIRECT = TABLE_DIRECT.copy()
660-
self.TABLE_R = TABLE_R.copy()
661659
self.MAP_DIRECT = (self.TABLE_DIRECT,)
662660
self.MAP_R = (self.TABLE_R, -1)
663661

0 commit comments

Comments
 (0)