Mercurial > cpython-lru_cache-weakref
diff Lib/distutils/command/install_data.py @ 19700:fbaf4e55263f legacy-trunk
[Bug #444589] Record empty directories in the install_data command
Slightly modified version of patch from Jon Nelson (jnelson).
| author | Andrew M. Kuchling <amk@amk.ca> |
|---|---|
| date | Tue, 04 Sep 2001 20:42:08 +0000 |
| parents | a506f3b75694 |
| children | 42bfc98d295b |
line wrap: on
line diff
--- a/Lib/distutils/command/install_data.py Tue Sep 04 20:06:43 2001 +0000 +++ b/Lib/distutils/command/install_data.py Tue Sep 04 20:42:08 2001 +0000 @@ -63,10 +63,18 @@ elif self.root: dir = change_root(self.root, dir) self.mkpath(dir) - for data in f[1]: - data = convert_path(data) - (out, _) = self.copy_file(data, dir) - self.outfiles.append(out) + + if f[1] == []: + # If there are no files listed, the user must be + # trying to create an empty directory, so add the + # directory to the list of output files. + self.outfiles.append(dir) + else: + # Copy files, adding them to the list of output files. + for data in f[1]: + data = convert_path(data) + (out, _) = self.copy_file(data, dir) + self.outfiles.append(out) def get_inputs (self): return self.data_files or []
