Skip to content

Commit aeb5600

Browse files
AdityaGarg8davide125
authored andcommitted
Use os.path.relpath instead of lstrip
Using lstrip sometimes broken the folder names in wifi folder by removing the "C" in the relpath. A code similar to the following was added to debug: if props: log.error(f"Unhandled properties found: {props} in file {relpath}") assert not props and the result was: Unhandled properties found: {'': '4355'} in file -4355__s-C1/P-hawaii-ID_M-YSBC_V-m__m-2.3.txt Traceback (most recent call last): File "/home/aditya/firmware.sh", line 905, in <module> wifi_col = WiFiFWCollection(sys.argv[1]+"/wifi") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/aditya/firmware.sh", line 737, in __init__ self.load(source_path) File "/home/aditya/firmware.sh", line 776, in load assert not props AssertionError Signed-off-by: Aditya Garg <[email protected]>
1 parent abb32a0 commit aeb5600

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

asahi_firmware/wifi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def load(self, source_path):
4545
dirnames.remove("perf")
4646
if "assert" in dirnames:
4747
dirnames.remove("assert")
48-
subpath = dirpath.lstrip(source_path)
48+
subpath = os.path.relpath(dirpath, source_path)
4949
for name in sorted(filenames):
5050
if not any(name.endswith("." + i) for i in self.EXTMAP):
5151
continue

0 commit comments

Comments
 (0)