I've upgraded my application to Python 3.7 and to the latest version of Alembic which triggers an exception when `context.get_current_revision()` is called.
```
File "app.py", line 395, in check_database_version
current_rev = context.get_current_revision()
File "~/env-py3.7/lib/python3.7/site-packages/alembic/runtime/migration.py", line 239, in get_current_revision
heads = self.get_current_heads()
File "~/env-py3.7/lib/python3.7/site-packages/alembic/runtime/migration.py", line 289, in get_current_heads
row[0] for row in self.connection.execute(self._version.select())
File "~/env-py3.7/lib/python3.7/site-packages/alembic/runtime/migration.py", line 289, in <genexpr>
row[0] for row in self.connection.execute(self._version.select())
RuntimeError: generator raised StopIteration
```
I think this is due to PEP 479.
PEP 479 is enabled for all code in Python 3.7, meaning that StopIteration exceptions raised directly or indirectly in coroutines and generators are transformed into RuntimeError exceptions. (Contributed by Yury Selivanov in bpo-32670.)
I changed `ResultProxy.__iter__()` to:
```
class ResultProxy
...
def __iter__(self):
while True:
row = self.fetchone()
if row is None:
# raise StopIteration
return
else:
yield row
```
which seems to resolve the problem. Is this a problem with Alembic and an incompatibility with Python 3.7, and is this expected to be fixed soon?