Skip to content

Commit

Permalink
Get ready for release 5.0.3
Browse files Browse the repository at this point in the history
Update 3.9 opcode information
  • Loading branch information
rocky committed Jul 28, 2020
1 parent f715a67 commit 1701a39
Show file tree
Hide file tree
Showing 9 changed files with 330 additions and 19 deletions.
9 changes: 8 additions & 1 deletion NEWS.md
@@ -1,4 +1,11 @@
5.0.2 2020-06-28
5.0.3 2020-07-28
================

* Add versions 3.8.5, 3.7.8, and 3.6.11
* Clarify changes to 3.8 ROT_FOUR
* Update 3.9 magics and opcodes

5.0.2 2020-07-25
================

* Add Python 3.8.4 as a 3.8 release
Expand Down
6 changes: 3 additions & 3 deletions admin-tools/how-to-make-a-release.md
Expand Up @@ -62,8 +62,8 @@

# Make packages and tag

$ . ./admin-tools/make-dist-older.sh
$ pyenv local 3.8.4
$ admin-tools/make-dist-older.sh
$ pyenv local 3.8.5
$ twine check dist/xdis-$VERSION*
$ git tag release-python-2.4-$VERSION
$ . ./admin-tools/make-dist-newer.sh
Expand All @@ -72,7 +72,7 @@
# Check package on github

$ [[ ! -d /tmp/gittest ]] && mkdir /tmp/gittest; pushd /tmp/gittest
$ pyenv local 3.8.3
$ pyenv local 3.8.4
$ pip install -e git://github.com/rocky/python-xdis.git#egg=xdis
$ pydisasm --help
$ pip uninstall xdis
Expand Down
260 changes: 260 additions & 0 deletions pytest/stackeffect/se39.py
@@ -0,0 +1,260 @@
# Python 3.9 Stack effects

[
-100, # 0
-1, # 1,
0, # 2,
0, # 3,
1, # 4,
2, # 5,
0, # 6,
-100, # 7
-100, # 8
0, # 9,
0, # 10,
0, # 11,
0, # 12,
-100, # 13
-100, # 14
0, # 15,
-1, # 16,
-1, # 17,
-100, # 18
-1, # 19,
-1, # 20,
-100, # 21
-1, # 22,
-1, # 23,
-1, # 24,
-1, # 25,
-1, # 26,
-1, # 27,
-1, # 28,
-1, # 29,
-100, # 30
-100, # 31
-100, # 32
-100, # 33
-100, # 34
-100, # 35
-100, # 36
-100, # 37
-100, # 38
-100, # 39
-100, # 40
-100, # 41
-100, # 42
-100, # 43
-100, # 44
-100, # 45
-100, # 46
-100, # 47
-3, # 48,
1, # 49,
0, # 50,
1, # 51,
1, # 52,
-100, # 53
-7, # 54,
-1, # 55,
-1, # 56,
-1, # 57,
-100, # 58
-1, # 59,
-3, # 60,
-2, # 61,
-1, # 62,
-1, # 63,
-1, # 64,
-1, # 65,
-1, # 66,
-1, # 67,
0, # 68,
0, # 69,
-1, # 70,
1, # 71,
-1, # 72,
0, # 73,
1, # 74,
-1, # 75,
-1, # 76,
-1, # 77,
-1, # 78,
-1, # 79,
-100, # 80
-100, # 81
0, # 82,
-1, # 83,
-1, # 84,
0, # 85,
0, # 86,
0, # 87,
-100, # 88
-3, # 89,
-1, # 90,
0, # 91,
-100, # 92
1, # 93,
-100, # 94
-2, # 95,
-1, # 96,
-1, # 97,
0, # 98,
-100, # 99
1, # 100,
1, # 101,
-100, # 102
-100, # 103
-100, # 104
-100, # 105
0, # 106,
-1, # 107,
-1, # 108,
1, # 109,
0, # 110,
0, # 111,
0, # 112,
0, # 113,
-1, # 114,
-1, # 115,
1, # 116,
-1, # 117,
-1, # 118,
-100, # 119
-100, # 120
-2, # 121,
6, # 122,
-100, # 123
1, # 124,
-1, # 125,
0, # 126,
-100, # 127
-100, # 128
-100, # 129
-100, # 130
-100, # 131
-100, # 132
-100, # 133
-100, # 134
1, # 135,
1, # 136,
-1, # 137,
0, # 138,
-100, # 139
-100, # 140
-100, # 141
-100, # 142
6, # 143,
0, # 144,
-1, # 145,
-1, # 146,
-2, # 147,
1, # 148,
-100, # 149
-100, # 150
-100, # 151
-100, # 152
-100, # 153
5, # 154,
-100, # 155
-100, # 156
-100, # 157
-100, # 158
-100, # 159
1, # 160,
-100, # 161
-1, # 162,
-1, # 163,
-1, # 164,
-1, # 165,
-100, # 166
-100, # 167
-100, # 168
-100, # 169
-100, # 170
-100, # 171
-100, # 172
-100, # 173
-100, # 174
-100, # 175
-100, # 176
-100, # 177
-100, # 178
-100, # 179
-100, # 180
-100, # 181
-100, # 182
-100, # 183
-100, # 184
-100, # 185
-100, # 186
-100, # 187
-100, # 188
-100, # 189
-100, # 190
-100, # 191
-100, # 192
-100, # 193
-100, # 194
-100, # 195
-100, # 196
-100, # 197
-100, # 198
-100, # 199
-100, # 200
-100, # 201
-100, # 202
-100, # 203
-100, # 204
-100, # 205
-100, # 206
-100, # 207
-100, # 208
-100, # 209
-100, # 210
-100, # 211
-100, # 212
-100, # 213
-100, # 214
-100, # 215
-100, # 216
-100, # 217
-100, # 218
-100, # 219
-100, # 220
-100, # 221
-100, # 222
-100, # 223
-100, # 224
-100, # 225
-100, # 226
-100, # 227
-100, # 228
-100, # 229
-100, # 230
-100, # 231
-100, # 232
-100, # 233
-100, # 234
-100, # 235
-100, # 236
-100, # 237
-100, # 238
-100, # 239
-100, # 240
-100, # 241
-100, # 242
-100, # 243
-100, # 244
-100, # 245
-100, # 246
-100, # 247
-100, # 248
-100, # 249
-100, # 250
-100, # 251
-100, # 252
-100, # 253
-100, # 254
-100, # 255
]
9 changes: 6 additions & 3 deletions pytest/test_bytecode.py
Expand Up @@ -78,7 +78,10 @@ def test_find_linestarts():
assert got_no_dups == expect

got_with_dups = list(findlinestarts(bug_loop.__code__, dup_lines=True))
assert len(got_no_dups) < len(got_with_dups)
if sys.version_info[0:2] >= (3,9):
assert len(got_no_dups) <= len(got_with_dups)
else:
assert len(got_no_dups) < len(got_with_dups)

# FIXME: a feature of doing code this way is that
# this compiles to the running version of code
Expand Down Expand Up @@ -176,6 +179,6 @@ def test_get_jump_targets():
assert expect == offset_map

if __name__ == "__main__":
test_get_jump_targets()
# test_get_jump_targets()
# test_offset2line()
# test_find_linestarts()
test_find_linestarts()
11 changes: 7 additions & 4 deletions pytest/test_stack_effect.py
Expand Up @@ -22,7 +22,7 @@ def test_stack_effect_fixed():
versions = ((2, 5), (2, 6), (2, 7),
(3, 0), (3, 1), (3, 2), (3, 3),
(3, 4), (3, 5),
(3, 6), (3, 7), (3, 8), )
(3, 6), (3, 7), (3, 8), (3, 9))
for version in versions:
v_str = "%s%s" % (version[0], version[1])
opc = get_opcode(version, False)
Expand Down Expand Up @@ -77,7 +77,10 @@ def test_stack_effect_vs_dis():

def test_one(xdis_args, dis_args, has_arg):
effect = xstack_effect(*xdis_args)
check_effect = dis.stack_effect(*dis_args)
try:
check_effect = dis.stack_effect(*dis_args)
except:
from trepan.api import debug; debug()
assert effect != -100, (
"%d (%s) needs adjusting; should be: should have effect %d"
% (opcode, opname, check_effect)
Expand Down Expand Up @@ -138,5 +141,5 @@ def test_one(xdis_args, dis_args, has_arg):


if __name__ == "__main__":
test_stack_effect_fixed()
# test_stack_effect_vs_dis()
# test_stack_effect_fixed()
test_stack_effect_vs_dis()

0 comments on commit 1701a39

Please sign in to comment.