summaryrefslogtreecommitdiff
path: root/builder.py
diff options
context:
space:
mode:
authorSylvain Th?nault <thenault@gmail.com>2014-03-26 14:20:42 +0100
committerSylvain Th?nault <thenault@gmail.com>2014-03-26 14:20:42 +0100
commit64c7cd458ed099b24a5e323eef679a9419439c08 (patch)
tree4c077a4082b35a3b152e31cef57b5b8a9c3c6593 /builder.py
parent1175e1a698768aeaddb37dafc916a90f15f86b7a (diff)
parent0b64b5075802793dc68da98f9591ec927e14ffe4 (diff)
downloadastroid-64c7cd458ed099b24a5e323eef679a9419439c08.tar.gz
Merged in flyingsheep/astroid (pull request #15)
AstroidBuilder.string_build was incompatible with file_stream
Diffstat (limited to 'builder.py')
-rw-r--r--builder.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/builder.py b/builder.py
index d4a9a8e..0271f71 100644
--- a/builder.py
+++ b/builder.py
@@ -44,6 +44,7 @@ if sys.version_info >= (3, 0):
def open_source_file(filename):
byte_stream = open(filename, 'bU')
encoding = detect_encoding(byte_stream.readline)[0]
+ byte_stream.close()
stream = open(filename, 'U', encoding=encoding)
try:
data = stream.read()
@@ -101,6 +102,12 @@ class AstroidBuilder(InspectBuilder):
# this is a built-in module
# get a partial representation by introspection
node = self.inspect_build(module, modname=modname, path=path)
+ # we have to handle transformation by ourselves since the rebuilder
+ # isn't called for builtin nodes
+ #
+ # XXX it's then only called for Module nodes, not for underlying
+ # nodes
+ node = self._manager.transform(node)
return node
def file_build(self, path, modname=None):