Created
February 7, 2014 22:21
-
-
Save Wilfred/8873205 to your computer and use it in GitHub Desktop.
Inspecting whether a file handle is open in RPython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[translation:info] Error: | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/goal/translate.py", line 318, in main | |
[translation:info] drv.proceed(goals) | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 534, in proceed | |
[translation:info] return self._execute(goals, task_skip = self._maybe_skip()) | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute | |
[translation:info] res = self._do(goal, taskcallable, *args, **kwds) | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 283, in _do | |
[translation:info] res = func() | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 320, in task_annotate | |
[translation:info] s = annotator.build_types(self.entry_point, self.inputtypes) | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/annotator/annrpython.py", line 91, in build_types | |
[translation:info] return self.build_graph_types(flowgraph, inputcells, complete_now=complete_now) | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/annotator/annrpython.py", line 145, in build_graph_types | |
[translation:info] self.complete() | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/annotator/annrpython.py", line 221, in complete | |
[translation:info] raise annmodel.AnnotatorError(text) | |
[translation:ERROR] AnnotatorError: | |
[translation:ERROR] | |
[translation:ERROR] Blocked block -- operation cannot succeed | |
[translation:ERROR] | |
[translation:ERROR] v1 = getattr(v0, ('closed')) | |
[translation:ERROR] | |
[translation:ERROR] In <FunctionGraph of (files:4)entry_point at 0x2823bd0>: | |
[translation:ERROR] Happened at file files.py line 6 | |
[translation:ERROR] | |
[translation:ERROR] f = open("/tmp/test.txt", 'w') | |
[translation:ERROR] ==> print "f is closed: %s" % f.closed | |
[translation:ERROR] | |
[translation:ERROR] Known variable annotations: | |
[translation:ERROR] v0 = SomeInstance(can_be_None=False, classdef=rpython.rlib.rfile.RFile) | |
[translation:ERROR] | |
[translation] start debugger... | |
> /home/wilfred/projects/trifle/src/pypy/rpython/annotator/annrpython.py(221)complete() | |
-> raise annmodel.AnnotatorError(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def entry_point(argv): | |
f = open("/tmp/test.txt", 'w') | |
print "f is closed: %s" % f.closed | |
def target(*args): | |
return entry_point, None | |
if __name__ == '__main__': | |
entry_point(sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment