default is stable

authorSylvain Th?nault <sylvain.thenault@logilab.fr>
changesetb261077ba24c
branchstable
phasepublic
hiddenno
parent revision#80c265e655cf Fix raw_building.object_build for pypy implementation. Closes #99583, #27ca2820b32b get_module_part should be given a context_file. Closes pyreverse crash #92362
child revision#c98dccf1a17b default is stable
files modified by this revision
ChangeLog
inference.py
raw_building.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1342433408 -7200
# Mon Jul 16 12:10:08 2012 +0200
# Branch stable
# Node ID b261077ba24cbfabafb31f883b91ff416914c492
# Parent 27ca2820b32b05430021e6ee95b6184c0f6ebca8
# Parent 80c265e655cfbe09fe302e87f74bddd1ac97e0be
default is stable

diff --git a/ChangeLog b/ChangeLog
@@ -1,10 +1,12 @@
1  Change log for the astng package
2  ================================
3 
4    --
5 - * #92362: fix pyreverse crash on relative import
6 +    * #92362: fix pyreverse crash on relative import
7 +    * #99583: fix raw_building.object_build for pypy implementation
8 +    * use `open` rather than `file` in scoped_nodes as 2to3 miss it
9 
10  2011-12-08  --  0.23.1
11      * #62295: avoid "OSError: Too many open files" by moving
12        .file_stream as a Module property opening the file only when needed
13 
diff --git a/inference.py b/inference.py
@@ -243,10 +243,11 @@
14          if index is YES:
15              yield YES
16              return
17          try:
18              # suppose it's a Tuple/List node (attribute error else)
19 +            # XXX infer self.value?
20              assigned = self.value.getitem(index.value, context)
21          except AttributeError:
22              raise InferenceError()
23          except (IndexError, TypeError):
24              yield YES
diff --git a/raw_building.py b/raw_building.py
@@ -238,14 +238,18 @@
25                  continue
26              if ismethod(member):
27                  member = member.im_func
28              if isfunction(member):
29                  # verify this is not an imported function
30 -                if member.func_code.co_filename != getattr(self._module, '__file__', None):
31 +                filename = getattr(member.func_code, 'co_filename', None)
32 +                if filename is None:
33 +                    assert isinstance(member, object)
34 +                    object_build_methoddescriptor(node, member, name)
35 +                elif filename != getattr(self._module, '__file__', None):
36                      attach_dummy_node(node, name, member)
37 -                    continue
38 -                object_build_function(node, member, name)
39 +                else:
40 +                    object_build_function(node, member, name)
41              elif isbuiltin(member):
42                  if self.imported_member(node, member, name):
43                      #if obj is object:
44                      #    print 'skippp', obj, name, member
45                      continue