hannosch/profilestats — pull request #1 by lukasgraf (2013-11-08 20:38:11+00:00)
Title: Support for Python 3.x.

I made some small modifications to make `profilestats` run on Python 3.x.

They all concern the opening of the output file:

```python
with file('cachegrind.out.profilestats', "wb") as f:
conv.output(f)
```

- `file` isn't a builtin on Python 3.x any more - using `open()` instead
- Change the file mode to `'w'` - writing to a `BufferedWriter` instance open in `'wb'` mode on 3.x doesn't work, and the file content is actually text, not binary.
- Python 2.5 doesn't support the `with` statement yet.

So I rewrote it as:

```python
f = open('cachegrind.out.profilestats', "w")
conv.output(f)
f.close()
```

With these changes, I was able to install and use `profilestats` on Python 3.3 (with a patched source version of `pyprof2calltree` which I also made a [pull-request](https://github.com/pwaller/pyprof2calltree/pull/2) for). I checked that it (still) works on all the Python versions declared in the trove classifiers, which are:
- `Programming Language :: Python :: 2.5`
- `Programming Language :: Python :: 2.6`
- `Programming Language :: Python :: 2.7`
- `Programming Language :: Python :: 3.2`
- `Programming Language :: Python :: 3.3`