Merge lp://staging/~exarkun/game/getTerrain-on-pypy into lp://staging/game

Proposed by Jean-Paul Calderone
Status: Needs review
Proposed branch: lp://staging/~exarkun/game/getTerrain-on-pypy
Merge into: lp://staging/game
Diff against target: 16 lines (+3/-3)
1 file modified
gam3/network.py (+3/-3)
To merge this branch: bzr merge lp://staging/~exarkun/game/getTerrain-on-pypy
Reviewer Review Type Date Requested Status
Game Hackers Pending
Review via email: mp+238831@code.staging.launchpad.net

Description of the change

This change fixes a test failure when the suite is run on PyPy:

```
[ERROR]
Traceback (most recent call last):
  File "/tmp/game/gam3/test/test_network.py", line 388, in test_getTerrain
    [args] = self.getCommands(SetTerrain)
exceptions.ValueError: expected length 1, got 0

gam3.test.test_network.NetworkTests.test_getTerrain
```

The cause is the difference in behavior of numpy on CPython vs PyPy when given float indexes. On CPython these are silently truncated to integers (the correct behavior in this case). On PyPy this usage is an error. Arguably this is a compatibility bug in PyPy's numpy - but using floats here is dumb and unintentional so it's worth fixing in Game anyway.

To post a comment you must log in.
51. By Jean-Paul Calderone

update to upstream

Unmerged revisions

51. By Jean-Paul Calderone

update to upstream

50. By Jean-Paul Calderone

Vector turns its values into floats. Turn them back into integers before using them in a known-integer context.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: