1 |
Author: zmedico |
2 |
Date: 2010-01-29 18:45:41 +0000 (Fri, 29 Jan 2010) |
3 |
New Revision: 15236 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.7/pym/portage/util.py |
7 |
Log: |
8 |
Handle AttributeError inside atomic_ofstream.__del__. Thanks to Cardoe for |
9 |
reporting. (trunk r15168) |
10 |
|
11 |
Modified: main/branches/2.1.7/pym/portage/util.py |
12 |
=================================================================== |
13 |
--- main/branches/2.1.7/pym/portage/util.py 2010-01-29 18:45:33 UTC (rev 15235) |
14 |
+++ main/branches/2.1.7/pym/portage/util.py 2010-01-29 18:45:41 UTC (rev 15236) |
15 |
@@ -1009,9 +1009,13 @@ |
16 |
def __del__(self): |
17 |
"""If the user does not explicitely call close(), it is |
18 |
assumed that an error has occurred, so we abort().""" |
19 |
- f = object.__getattribute__(self, '_file') |
20 |
- if not f.closed: |
21 |
- self.abort() |
22 |
+ try: |
23 |
+ f = object.__getattribute__(self, '_file') |
24 |
+ except AttributeError: |
25 |
+ pass |
26 |
+ else: |
27 |
+ if not f.closed: |
28 |
+ self.abort() |
29 |
# ensure destructor from the base class is called |
30 |
base_destructor = getattr(ObjectProxy, '__del__', None) |
31 |
if base_destructor is not None: |