App Engine Python SDK version 1.7.4 (2)
[gae.git] / python / lib / django_1_4 / django / utils / copycompat.py
blobbd1a761f8afc74378d1d161eb10c88d371ecd81d
1 """
2 Fixes Python 2.4's failure to deepcopy unbound functions.
3 """
5 import copy
6 import types
7 import warnings
9 warnings.warn("django.utils.copycompat is deprecated; use the native copy module instead",
10 PendingDeprecationWarning)
12 # Monkeypatch copy's deepcopy registry to handle functions correctly.
13 if (hasattr(copy, '_deepcopy_dispatch') and types.FunctionType not in copy._deepcopy_dispatch):
14 copy._deepcopy_dispatch[types.FunctionType] = copy._deepcopy_atomic
16 # Pose as the copy module now.
17 del copy, types
18 from copy import *