Skip to content

Commit

Permalink
Merge pull request #5836 from drew2a/fix/5831
Browse files Browse the repository at this point in the history
Add to makedirs the argument `exist_ok=True`
  • Loading branch information
drew2a authored Dec 11, 2020
2 parents 5df91b8 + 83670e5 commit a50468f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/tribler-core/tribler_core/config/tribler_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ def write(self):
"""
Write the configuration to the config file in the state dir as specified in the config.
"""
if not self.get_state_dir().exists():
os.makedirs(self.get_state_dir())
self.config.filename = self.get_state_dir() / CONFIG_FILENAME
state_dir = self.get_state_dir()
if not state_dir.exists():
os.makedirs(state_dir, exist_ok=True)
self.config.filename = state_dir / CONFIG_FILENAME
self.config.write()

def _obtain_port(self, section, option):
Expand Down

0 comments on commit a50468f

Please sign in to comment.