Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Dec 9, 2023
1 parent 8b78ba7 commit 6baea7b
Show file tree
Hide file tree
Showing 34 changed files with 3,069 additions and 6,306 deletions.
6 changes: 5 additions & 1 deletion _pydevd_bundle/pydevd_bytecode_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

from _pydev_bundle import pydev_log
from types import CodeType
from _pydevd_frame_eval.vendored.bytecode.instr import _Variable
from _pydevd_frame_eval.vendored.bytecode.instr import _Variable, TryBegin, \
TryEnd
from _pydevd_frame_eval.vendored import bytecode
from _pydevd_frame_eval.vendored.bytecode import cfg as bytecode_cfg
import dis
Expand Down Expand Up @@ -685,6 +686,9 @@ def _get_smart_step_into_targets(code):
print('\nStart block----')
stack = _StackInterpreter(block)
for instr in block:
if isinstance(instr, (TryBegin, TryEnd)):
# No name for these
continue
try:
func_name = 'on_%s' % (instr.name,)
func = getattr(stack, func_name, None)
Expand Down
2 changes: 1 addition & 1 deletion _pydevd_frame_eval/vendored/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pip install bytecode --target .

or from master (if needed for some early bugfix):

python -m pip install https://github.com/MatthieuDartiailh/bytecode/archive/main.zip --target .
python -m pip install git+https://github.com/MatthieuDartiailh/bytecode.git --target .

Then run 'pydevd_fix_code.py' to fix the imports on the vendored file, run its tests (to see
if things are still ok) and commit.
Expand Down

This file was deleted.

42 changes: 0 additions & 42 deletions _pydevd_frame_eval/vendored/bytecode-0.13.0.dev0.dist-info/RECORD

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright (c) 2016 Red Hat.
Copyright Contributors to the bytecode project.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
Metadata-Version: 2.1
Name: bytecode
Version: 0.15.2.dev4+gc87faa2
Summary: Python module to generate and modify bytecode
Author-email: Victor Stinner <[email protected]>
Maintainer-email: "Matthieu C. Dartiailh" <[email protected]>
License: The MIT License (MIT)
Copyright Contributors to the bytecode project.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project-URL: homepage, https://github.com/MatthieuDartiailh/bytecode
Project-URL: documentation, https://bytecode.readthedocs.io/en/latest/
Project-URL: repository, https://github.com/MatthieuDartiailh/bytecode
Project-URL: changelog, https://github.com/MatthieuDartiailh/bytecode/blob/main/doc/changelog.rst
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: COPYING
Requires-Dist: typing-extensions ; python_version < "3.10"

********
bytecode
********

.. image:: https://img.shields.io/pypi/v/bytecode.svg
:alt: Latest release on the Python Cheeseshop (PyPI)
:target: https://pypi.python.org/pypi/bytecode

.. image:: https://github.com/MatthieuDartiailh/bytecode/workflows/Continuous%20Integration/badge.svg
:target: https://github.com/MatthieuDartiailh/bytecode/actions
:alt: Continuous integration

.. image:: https://github.com/MatthieuDartiailh/bytecode/workflows/Documentation%20building/badge.svg
:target: https://github.com/MatthieuDartiailh/bytecode/actions
:alt: Documentation building

.. image:: https://img.shields.io/codecov/c/github/MatthieuDartiailh/bytecode/master.svg
:alt: Code coverage of bytecode on codecov.io
:target: https://codecov.io/github/MatthieuDartiailh/bytecode

.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff
:alt: Ruff

``bytecode`` is a Python module to generate and modify bytecode.

* `bytecode project homepage at GitHub
<https://github.com/MatthieuDartiailh/bytecode>`_ (code, bugs)
* `bytecode documentation
<https://bytecode.readthedocs.io/>`_
* `Download latest bytecode release at the Python Cheeseshop (PyPI)
<https://pypi.python.org/pypi/bytecode>`_

Install bytecode: ``python3 -m pip install bytecode``. It requires Python 3.8
or newer. The latest release that supports Python 3.7 and 3.6 is 0.13.0.
The latest release that supports Python 3.5 is 0.12.0. For Python 2.7 support,
have a look at `dead-bytecode <https://github.com/p403n1x87/dead-bytecode>`_
instead.

Example executing ``print('Hello World!')``:

.. code:: python

from bytecode import Instr, Bytecode

bytecode = Bytecode([Instr("LOAD_NAME", 'print'),
Instr("LOAD_CONST", 'Hello World!'),
Instr("CALL_FUNCTION", 1),
Instr("POP_TOP"),
Instr("LOAD_CONST", None),
Instr("RETURN_VALUE")])
code = bytecode.to_code()
exec(code)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
bytecode-0.15.2.dev4+gc87faa2.dist-info/COPYING,sha256=15CDvwHVcioF_s6S_mWdkWdw96tvB21WZKc8jvc8N5M,1094
bytecode-0.15.2.dev4+gc87faa2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
bytecode-0.15.2.dev4+gc87faa2.dist-info/METADATA,sha256=msfGAb_7qRcxbHQwTg-b2IAAXopiE6KWzm5F2zCSPMg,4780
bytecode-0.15.2.dev4+gc87faa2.dist-info/RECORD,,
bytecode-0.15.2.dev4+gc87faa2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
bytecode-0.15.2.dev4+gc87faa2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
bytecode-0.15.2.dev4+gc87faa2.dist-info/direct_url.json,sha256=If2BeyiZnL-o6_qt3rkJuCphTAj0k2pM1S7TvbCLAAw,145
bytecode-0.15.2.dev4+gc87faa2.dist-info/top_level.txt,sha256=9BhdB7HqYZ-PvHNoWX6ilwLYWQqcgEOLwdb3aXm5Gys,9
bytecode/__init__.py,sha256=QyRvM53HT111OMumYJRD1FC3al7MlZL1bXf2MJ5XBMo,6848
bytecode/__pycache__/__init__.cpython-311.pyc,,
bytecode/__pycache__/bytecode.cpython-311.pyc,,
bytecode/__pycache__/cfg.cpython-311.pyc,,
bytecode/__pycache__/concrete.cpython-311.pyc,,
bytecode/__pycache__/flags.cpython-311.pyc,,
bytecode/__pycache__/instr.cpython-311.pyc,,
bytecode/__pycache__/version.cpython-311.pyc,,
bytecode/bytecode.py,sha256=6oveflTRGnrzTQEP9Z0tp6ySwmXQ_DXIibdAGOZt5lY,11126
bytecode/cfg.py,sha256=F8GhLWqDJlQc8cbL6X8HMa1QSVLGmZmBuYC8G4P201A,41794
bytecode/concrete.py,sha256=kVTVMtA6yUsxLFa6LpCiXOUlgo3OxCIS2ykANO-MWjw,52189
bytecode/flags.py,sha256=2ONreTJOAFDPXlDZle1t9FnkxI1E7SQGj3DDtrnYoMg,6093
bytecode/instr.py,sha256=T0y13qaYG_9N6KXoafmFASKHITqdkvjOQnEor6QkF-I,26785
bytecode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
bytecode/version.py,sha256=nfCHWDf48S87YSKe2l_-l3kZTq6AFgQOPx7-Q20xhnE,566
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.36.2)
Generator: bdist_wheel (0.42.0)
Root-Is-Purelib: true
Tag: py3-none-any

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"url": "https://github.com/MatthieuDartiailh/bytecode.git", "vcs_info": {"commit_id": "c87faa29ccc0cbc1198d581500848f1ab9096bd5", "vcs": "git"}}
Loading

0 comments on commit 6baea7b

Please sign in to comment.