Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Fixes #290: pyPrint accepts any filelike, with sys.stdout fallback #304

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

alanjds
Copy link
Contributor

@alanjds alanjds commented May 1, 2017

Gets sys.stdout from SysmoduleDict['stdout'], that exists and could be replaced (after #302 got merged)

pyPrint allows any filelike *Object to be printed to.

TBD: Factor out the method invocation logic to some func (o *Object) Invoke(f *Frame, method *Str)

@alanjds
Copy link
Contributor Author

alanjds commented Jun 13, 2017

Have no idea why this is broke. Halp.
screen shot 2017-06-13 at 11 34 43

Left is OSX. Right is Linux

@trotterdylan
Copy link
Contributor

The types_test failure is because types.py defines ModuleType as type(sys) and types_test checks that it's the same type as go.grumpy.ModuleType. sys is now a different kind of object.

I would remove that line from types.py and add from __go__.grumpy import ModuleType to the top of that file.

The other issue is a transient failure due to a race condition in TestRunMain. I can trigger it reasonably consistently as follows:

$ GOPATH=$PWD/build go test grumpy -test.run=TestRunMain -count=100
--- FAIL: TestRunMain (0.00s)
	module_test.go:300: runMainRedirectStderr() failed: read |0: bad file descriptor
	module_test.go:300: runMainRedirectStderr() failed: read |0: bad file descriptor
	module_test.go:300: runMainRedirectStderr() failed: read |0: bad file descriptor
	module_test.go:300: runMainRedirectStderr() failed: read |0: bad file descriptor
FAIL
FAIL	grumpy	0.047s

I think this is similar to #282. This is not due to your change. Just restart the build if you encounter that again.

@alanjds
Copy link
Contributor Author

alanjds commented Jun 16, 2017

OSX: Thanks. Will take a look on types.py. I had used the import errno; type(errno) on the "hack module" as errno is a so simpler module. Is this acceptable for you?

Linux: Good to know. However, how can I restart the build on Travis? Last time I had sent a pointless commit to trigger it, but this adds noise to the history.

@alanjds
Copy link
Contributor Author

alanjds commented Jun 16, 2017

I had hit another strange error here, on itertools_test.py:

NameError: name '__name__' is not defined
exit status 1

Bisected and found its root on f745cdb, but it makes no sense.

As this PR will not be merged until __getattr__ is working, will leave it as is. This seems as a symptom of another undiscovered bug on the module/types stuff.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants