~ubuntu-branches/ubuntu/saucy/python-django/saucy-updates

« back to all changes in this revision

Viewing changes to django/utils/copycompat.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2010-05-21 07:52:55 UTC
  • mfrom: (1.3.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100521075255-ii78v1dyfmyu3uzx
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
Fixes Python 2.4's failure to deepcopy unbound functions.
 
3
"""
 
4
 
 
5
import copy
 
6
import types
 
7
 
 
8
# Monkeypatch copy's deepcopy registry to handle functions correctly.
 
9
if (hasattr(copy, '_deepcopy_dispatch') and types.FunctionType not in copy._deepcopy_dispatch):
 
10
    copy._deepcopy_dispatch[types.FunctionType] = copy._deepcopy_atomic
 
11
 
 
12
# Pose as the copy module now.
 
13
del copy, types
 
14
from copy import *