From 6923bb47129e359fd63a459802e7fbfb35156e7f Mon Sep 17 00:00:00 2001 From: Vijay Kumar Banerjee Date: Fri, 2 Apr 2021 19:17:17 -0600 Subject: netlegacy: Use os.path to get the file extension --- netlegacy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'netlegacy.py') diff --git a/netlegacy.py b/netlegacy.py index 0889548..89176e6 100644 --- a/netlegacy.py +++ b/netlegacy.py @@ -40,9 +40,10 @@ for root, dirs, files in os.walk("."): dirs.append('./bsps/shared/net') include_files[root[2:]] = [] for name in files: - if name[-2:] == '.c': + ext = os.path.splitext(name)[1] + if ext == '.c': source_files.append(os.path.join(root, name)) - if name[-2:] == '.h' and name not in exclude_headers: + if ext == '.h' and name not in exclude_headers: include_files[root[2:]].append(os.path.join(root, name)) -- cgit v1.2.3