[Python-checkins] python/dist/src/Lib tarfile.py,1.16,1.17
loewis at users.sourceforge.net
loewis at users.sourceforge.net
Fri Aug 20 08:35:48 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5496
Modified Files:
tarfile.py
Log Message:
Replace tricky and/or with straight-forward if:else:
Index: tarfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/tarfile.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** tarfile.py 18 Aug 2004 13:57:44 -0000 1.16
--- tarfile.py 20 Aug 2004 06:35:46 -0000 1.17
***************
*** 1138,1142 ****
tarinfo.uid = statres.st_uid
tarinfo.gid = statres.st_gid
! tarinfo.size = not stat.S_ISDIR(stmd) and statres.st_size or 0
tarinfo.mtime = statres.st_mtime
tarinfo.type = type
--- 1138,1146 ----
tarinfo.uid = statres.st_uid
tarinfo.gid = statres.st_gid
! if stat.S_ISDIR(stmd):
! # For a directory, the size must be 0
! tarinfo.size = 0
! else:
! tarinfo.size = statres.st_size
tarinfo.mtime = statres.st_mtime
tarinfo.type = type
More information about the Python-checkins
mailing list