Skip to content
Myr

Import uuid module late because it might be slow to import

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent df8f00b · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:click/types.py+1 added-1 removed
1import os2import sys3import stat4import uuid45from ._compat import open_stream, text_type, filename_to_ui, get_streerror6from .exceptions import BadParameter7from .utils import safecall, LazyFile
201 unmodified lines
209 name = 'uuid'210211 def convert(self, value, param, ctx):212 try:213 import uuid214 return uuid.UUID(value)215 except ValueError:216 self.fail('%s is not a valid UUID value' % value, param, ctx)217
214 unmodified lines