diff options
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r-- | Lib/tarfile.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 2f2197184c..c86248c1a4 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1150,7 +1150,8 @@ class TarFile(object): stmd = statres.st_mode if stat.S_ISREG(stmd): inode = (statres.st_ino, statres.st_dev) - if inode in self.inodes and not self.dereference: + if not self.dereference and \ + statres.st_nlink > 1 and inode in self.inodes: # Is it a hardlink to an already # archived file? type = LNKTYPE |