Skip to content

Commit 7edb67e

Browse files
authored
Merge pull request #713 from amlamarra/Don't-fail-when-current-directory-has-a-config.ini-file
Don't fail when the current working directory has a config.ini file
2 parents c89fc6e + edc2287 commit 7edb67e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pyshark/tshark/tshark.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33

44
from packaging import version
5+
from configparser import NoSectionError
56
import os
67
import subprocess
78
import sys
@@ -35,7 +36,10 @@ def get_process_path(tshark_path=None, process_name="tshark"):
3536
# Check if `config.ini` exists in the current directory or the pyshark directory
3637
config = get_config()
3738
if config:
38-
possible_paths.append(config.get(process_name, f"{process_name}_path"))
39+
try:
40+
possible_paths.append(config.get(process_name, f"{process_name}_path"))
41+
except NoSectionError:
42+
pass
3943

4044
# Add the user provided path to the search list
4145
if tshark_path is not None:

0 commit comments

Comments
 (0)