MCPcopy
hub / github.com/cool-RR/PySnooper / mkdir

Method mkdir

tests/mini_toolbox/pathlib.py:1450–1470  ·  view source on GitHub ↗

Create a new directory at this given path.

(self, mode=0o777, parents=False, exist_ok=False)

Source from the content-addressed store, hash-verified

1448 os.close(fd)
1449
1450 def mkdir(self, mode=0o777, parents=False, exist_ok=False):
1451 """
1452 Create a new directory at this given path.
1453 """
1454 if self._closed:
1455 self._raise_closed()
1456
1457 def _try_func():
1458 self._accessor.mkdir(self, mode)
1459
1460 def _exc_func(exc):
1461 if not parents or self.parent == self:
1462 raise exc
1463 self.parent.mkdir(parents=True, exist_ok=True)
1464 self.mkdir(mode, parents=False, exist_ok=exist_ok)
1465
1466 try:
1467 _try_except_filenotfounderror(_try_func, _exc_func)
1468 except OSError:
1469 if not exist_ok or not self.is_dir():
1470 raise
1471
1472 def chmod(self, mode):
1473 """

Callers 2

_exc_funcMethod · 0.95
_try_funcMethod · 0.80

Calls 3

_raise_closedMethod · 0.95
is_dirMethod · 0.95

Tested by

no test coverage detected