| OLD | NEW |
| (Empty) |
| 1 Return-Path: <twisted-commits-admin@twistedmatrix.com> | |
| 2 Delivered-To: exarkun@meson.dyndns.org | |
| 3 Received: from localhost [127.0.0.1] | |
| 4 by localhost with POP3 (fetchmail-6.2.1) | |
| 5 for exarkun@localhost (single-drop); Thu, 20 Mar 2003 14:50:20 -0500 (ES
T) | |
| 6 Received: from pyramid.twistedmatrix.com (adsl-64-123-27-105.dsl.austtx.swbell.n
et [64.123.27.105]) | |
| 7 by intarweb.us (Postfix) with ESMTP id 4A4A513EA4 | |
| 8 for <exarkun@meson.dyndns.org>; Thu, 20 Mar 2003 14:49:27 -0500 (EST) | |
| 9 Received: from localhost ([127.0.0.1] helo=pyramid.twistedmatrix.com) | |
| 10 by pyramid.twistedmatrix.com with esmtp (Exim 3.35 #1 (Debian)) | |
| 11 id 18w648-0007Vl-00; Thu, 20 Mar 2003 13:51:04 -0600 | |
| 12 Received: from acapnotic by pyramid.twistedmatrix.com with local (Exim 3.35 #1 (
Debian)) | |
| 13 id 18w63j-0007VK-00 | |
| 14 for <twisted-commits@twistedmatrix.com>; Thu, 20 Mar 2003 13:50:39 -0600 | |
| 15 To: twisted-commits@twistedmatrix.com | |
| 16 From: etrepum CVS <etrepum@twistedmatrix.com> | |
| 17 Reply-To: twisted-python@twistedmatrix.com | |
| 18 X-Mailer: CVSToys | |
| 19 Message-Id: <E18w63j-0007VK-00@pyramid.twistedmatrix.com> | |
| 20 Subject: [Twisted-commits] rebuild now works on python versions from 2.2.0 and u
p. | |
| 21 Sender: twisted-commits-admin@twistedmatrix.com | |
| 22 Errors-To: twisted-commits-admin@twistedmatrix.com | |
| 23 X-BeenThere: twisted-commits@twistedmatrix.com | |
| 24 X-Mailman-Version: 2.0.11 | |
| 25 Precedence: bulk | |
| 26 List-Help: <mailto:twisted-commits-request@twistedmatrix.com?subject=help> | |
| 27 List-Post: <mailto:twisted-commits@twistedmatrix.com> | |
| 28 List-Subscribe: <http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-commi
ts>, | |
| 29 <mailto:twisted-commits-request@twistedmatrix.com?subject=subscribe> | |
| 30 List-Id: <twisted-commits.twistedmatrix.com> | |
| 31 List-Unsubscribe: <http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-com
mits>, | |
| 32 <mailto:twisted-commits-request@twistedmatrix.com?subject=unsubscribe> | |
| 33 List-Archive: <http://twistedmatrix.com/pipermail/twisted-commits/> | |
| 34 Date: Thu, 20 Mar 2003 13:50:39 -0600 | |
| 35 | |
| 36 Modified files: | |
| 37 Twisted/twisted/python/rebuild.py 1.19 1.20 | |
| 38 | |
| 39 Log message: | |
| 40 rebuild now works on python versions from 2.2.0 and up. | |
| 41 | |
| 42 | |
| 43 ViewCVS links: | |
| 44 http://twistedmatrix.com/users/jh.twistd/viewcvs/cgi/viewcvs.cgi/twisted/python/
rebuild.py.diff?r1=text&tr1=1.19&r2=text&tr2=1.20&cvsroot=Twisted | |
| 45 | |
| 46 Index: Twisted/twisted/python/rebuild.py | |
| 47 diff -u Twisted/twisted/python/rebuild.py:1.19 Twisted/twisted/python/rebuild.py
:1.20 | |
| 48 --- Twisted/twisted/python/rebuild.py:1.19 Fri Jan 17 13:50:49 2003 | |
| 49 +++ Twisted/twisted/python/rebuild.py Thu Mar 20 11:50:08 2003 | |
| 50 @@ -206,15 +206,27 @@ | |
| 51 clazz.__dict__.clear() | |
| 52 clazz.__getattr__ = __getattr__ | |
| 53 clazz.__module__ = module.__name__ | |
| 54 + if newclasses: | |
| 55 + import gc | |
| 56 + if (2, 2, 0) <= sys.version_info[:3] < (2, 2, 2): | |
| 57 + hasBrokenRebuild = 1 | |
| 58 + gc_objects = gc.get_objects() | |
| 59 + else: | |
| 60 + hasBrokenRebuild = 0 | |
| 61 for nclass in newclasses: | |
| 62 ga = getattr(module, nclass.__name__) | |
| 63 if ga is nclass: | |
| 64 log.msg("WARNING: new-class %s not replaced by reload!" % reflect.q
ual(nclass)) | |
| 65 else: | |
| 66 - import gc | |
| 67 - for r in gc.get_referrers(nclass): | |
| 68 - if isinstance(r, nclass): | |
| 69 + if hasBrokenRebuild: | |
| 70 + for r in gc_objects: | |
| 71 + if not getattr(r, '__class__', None) is nclass: | |
| 72 + continue | |
| 73 r.__class__ = ga | |
| 74 + else: | |
| 75 + for r in gc.get_referrers(nclass): | |
| 76 + if getattr(r, '__class__', None) is nclass: | |
| 77 + r.__class__ = ga | |
| 78 if doLog: | |
| 79 log.msg('') | |
| 80 log.msg(' (fixing %s): ' % str(module.__name__)) | |
| 81 | |
| 82 | |
| 83 _______________________________________________ | |
| 84 Twisted-commits mailing list | |
| 85 Twisted-commits@twistedmatrix.com | |
| 86 http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-commits | |
| OLD | NEW |