Mercurial > repos > shellac > guppy_basecaller
comparison env/lib/python3.7/site-packages/pkg_resources/py31compat.py @ 5:9b1c78e6ba9c draft default tip
"planemo upload commit 6c0a8142489327ece472c84e558c47da711a9142"
| author | shellac |
|---|---|
| date | Mon, 01 Jun 2020 08:59:25 -0400 |
| parents | 79f47841a781 |
| children |
comparison
equal
deleted
inserted
replaced
| 4:79f47841a781 | 5:9b1c78e6ba9c |
|---|---|
| 1 import os | |
| 2 import errno | |
| 3 import sys | |
| 4 | |
| 5 from .extern import six | |
| 6 | |
| 7 | |
| 8 def _makedirs_31(path, exist_ok=False): | |
| 9 try: | |
| 10 os.makedirs(path) | |
| 11 except OSError as exc: | |
| 12 if not exist_ok or exc.errno != errno.EEXIST: | |
| 13 raise | |
| 14 | |
| 15 | |
| 16 # rely on compatibility behavior until mode considerations | |
| 17 # and exists_ok considerations are disentangled. | |
| 18 # See https://github.com/pypa/setuptools/pull/1083#issuecomment-315168663 | |
| 19 needs_makedirs = ( | |
| 20 six.PY2 or | |
| 21 (3, 4) <= sys.version_info < (3, 4, 1) | |
| 22 ) | |
| 23 makedirs = _makedirs_31 if needs_makedirs else os.makedirs |
