Merge remote-tracking branch 'origin/patch'

This commit is contained in:
Ryan Kurtz 2025-07-07 11:40:02 -04:00
commit fe335aa946
3 changed files with 10 additions and 1 deletions

View file

@ -325,6 +325,11 @@ import pdb # imports Python's pdb
import pdb_ # imports Ghidra's pdb
```
## Change History
__2.2.1:__
* PyGhidra now launches with the current working directory removed from `sys.path` to prevent
the potential for importing invalid modules from random `ghidra/` or `java/` directories that may
exist in the user's current working directory.
__2.2.0:__
* [`pyghidra.open_program()`](#pyghidraopen_program) and
[`pyghidra.run_script()`](#pyghidrarun_script) now accept a `nested_project_location` parameter

View file

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
##
__version__ = "2.2.0"
__version__ = "2.2.1"
# stub for documentation and typing
# this is mostly to hide the function parameter

View file

@ -429,6 +429,10 @@ class PyGhidraLauncher:
**jpype_kwargs
)
# Remove CWD from sys.path so we don't try to import from unintentional directories
# (i.e, an unrelated "ghidra" directory the user may have created)
sys.path.remove(os.getcwd())
# Install hooks into python importlib
sys.meta_path.append(_PyGhidraImportLoader())
sys.meta_path.append(_GhidraBundleFinder())