From 97a540b077095790ec250758c286f8fbba4975bf Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 5 Feb 2025 22:49:17 -0500 Subject: [PATCH] Small fix to hardlinking to deal with Joliet. pylint pointed out that we weren't necessarily handling all situations, which isn't quite true. Nevertheless, it is easy enough for us to change this and slightly improve performance along the way. Signed-off-by: Chris Lalancette --- pycdlib/pycdlib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pycdlib/pycdlib.py b/pycdlib/pycdlib.py index 6c2bb1e9..b397c63d 100644 --- a/pycdlib/pycdlib.py +++ b/pycdlib/pycdlib.py @@ -3102,7 +3102,9 @@ def _add_hard_link_to_inode(self, data_ino, length, file_mode, vd = self.pvd rr = self.rock_ridge xa = self.xa - elif joliet_new_path is not None: + else: + # Above we checked to make sure we got exactly one new path, so + # we know for certain that this is Joliet. if self.joliet_vd is None: raise pycdlibexception.PyCdlibInternalError('Tried to link to Joliet record on non-Joliet ISO') # ... to a file on the Joliet filesystem. @@ -3110,8 +3112,6 @@ def _add_hard_link_to_inode(self, data_ino, length, file_mode, vd = self.joliet_vd rr = '' xa = False - # Above we checked to make sure we got at least one new path, so we - # don't need to worry about the else situation here. new_rec = dr.DirectoryRecord() new_rec.new_file(vd, length, new_name, new_parent,