From 0e6870b5256d36ebda9fbea8553df2e699dc373c Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Wed, 13 Apr 2022 10:00:49 +0100 Subject: Avoid creating dist_info_dir before the command runs --- setuptools/command/dist_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command') diff --git a/setuptools/command/dist_info.py b/setuptools/command/dist_info.py index 79647bc7..aa7af48c 100644 --- a/setuptools/command/dist_info.py +++ b/setuptools/command/dist_info.py @@ -42,7 +42,6 @@ class dist_info(Command): dist = self.distribution project_dir = dist.src_root or os.curdir self.output_dir = Path(self.output_dir or project_dir) - self.output_dir.mkdir(parents=True, exist_ok=True) egg_info = self.reinitialize_command('egg_info') egg_info.egg_base = str(self.output_dir) @@ -55,6 +54,7 @@ class dist_info(Command): self.dist_info_dir = os.path.join(self.output_dir, f"{self.name}.dist-info") def run(self): + self.output_dir.mkdir(parents=True, exist_ok=True) self.egg_info.run() egg_info_dir = self.egg_info.egg_info log.info("creating '{}'".format(os.path.abspath(self.dist_info_dir))) -- cgit v1.2.1