summaryrefslogtreecommitdiff
path: root/astroid/brain/brain_uuid.py
blob: 45c2d051fe5fdbc8fba8be769c5ae1f9f67e06d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright (c) 2017-2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com>

# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER

"""Astroid hooks for the UUID module."""


from astroid import MANAGER
from astroid import nodes


def _patch_uuid_class(node):
    # The .int member is patched using __dict__
    node.locals["int"] = [nodes.Const(0, parent=node)]


MANAGER.register_transform(
    nodes.ClassDef, _patch_uuid_class, lambda node: node.qname() == "uuid.UUID"
)