Skip to content

Commit

Permalink
Merge pull request #713 from amlamarra/Don't-fail-when-current-direct…
Browse files Browse the repository at this point in the history
…ory-has-a-config.ini-file

Don't fail when the current working directory has a config.ini file
  • Loading branch information
KimiNewt authored Dec 4, 2024
2 parents c89fc6e + edc2287 commit 7edb67e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pyshark/tshark/tshark.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json

from packaging import version
from configparser import NoSectionError
import os
import subprocess
import sys
Expand Down Expand Up @@ -35,7 +36,10 @@ def get_process_path(tshark_path=None, process_name="tshark"):
# Check if `config.ini` exists in the current directory or the pyshark directory
config = get_config()
if config:
possible_paths.append(config.get(process_name, f"{process_name}_path"))
try:
possible_paths.append(config.get(process_name, f"{process_name}_path"))
except NoSectionError:
pass

# Add the user provided path to the search list
if tshark_path is not None:
Expand Down

0 comments on commit 7edb67e

Please sign in to comment.