Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Python Syntax in utils.py #23

Open
danpat opened this issue Jul 17, 2012 · 1 comment
Open

Invalid Python Syntax in utils.py #23

danpat opened this issue Jul 17, 2012 · 1 comment

Comments

@danpat
Copy link
Contributor

danpat commented Jul 17, 2012

From version 0.7.1, geoalchemy/utils.py:

line 39 reads:

    geomtype = geom[:geom.index["("]]

it should read:

    geomtype = geom[:geom.index("(")]

(note change of [] to ()). .index is a function, not a sequence type.

@danpat
Copy link
Contributor Author

danpat commented Jul 31, 2012

--- a/geoalchemy/utils.py
+++ b/geoalchemy/utils.py
@@ -36,7 +36,7 @@ def from_wkt (geom):
     elif geom.startswith("POLYGON"):
         geomtype = "Polygon"
     else:
-        geomtype = geom[:geom.index["("]]
+        geomtype = geom[:geom.index("(")]
         raise Exception("Unsupported geometry type %s" % geomtype)

     return {"type": geomtype, "coordinates": coords}

elemoine pushed a commit that referenced this issue Jan 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant