Skip to content

Commit

Permalink
Revert modification of sys.path when importing zeekclient
Browse files Browse the repository at this point in the history
This was removed in f93b8e1 but causes
problems on air-gapped systems.
  • Loading branch information
timwoj committed Dec 12, 2024
1 parent 1f249e9 commit 40394d7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion zeek-client
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ the idioms and primitives also used by the zkg package manager.
# https://pypi.org/project/argcomplete/#global-completion
# PYTHON_ARGCOMPLETE_OK

import os.path
import sys

import zeekclient
# For Zeek-bundled installation, prepend the Python path of the Zeek
# installation to the search path. This ensures we find the matching module
# first (or at all), avoiding potential conflicts with installations elsewhere
# on the system.
ZEEK_PYTHON_DIR = "@PY_MOD_INSTALL_DIR@"
if os.path.isdir(ZEEK_PYTHON_DIR):
sys.path.insert(0, os.path.abspath(ZEEK_PYTHON_DIR))
else:
ZEEK_PYTHON_DIR = None
import zeekclient # pylint: disable=wrong-import-position


def main():
Expand Down

0 comments on commit 40394d7

Please sign in to comment.