Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.1.X] When `GEOSFree` is not available on NT platforms, have to spe…

…cifically use the MS C library.

Backport of r12024 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12025 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 30c6021f80b5b7051a77b3df508ed41bcffcb8aa 1 parent db867be
@jbronn jbronn authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 django/contrib/gis/geos/prototypes/errcheck.py
View
9 django/contrib/gis/geos/prototypes/errcheck.py
@@ -1,6 +1,7 @@
"""
Error checking functions for GEOS ctypes prototype functions.
"""
+import os
from ctypes import c_void_p, string_at, CDLL
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.libgeos import lgeos, GEOS_VERSION
@@ -15,8 +16,12 @@
free.restype = None
else:
# Getting the `free` routine from the C library of the platform.
- # The C library is obtained by passing None into `CDLL`.
- libc = CDLL(None)
+ if os.name == 'nt':
+ # On NT, use the MS C library.
+ libc = CDLL('msvcrt')
+ else:
+ # On POSIX platforms C library is obtained by passing None into `CDLL`.
+ libc = CDLL(None)
free = libc.free
### ctypes error checking routines ###
Please sign in to comment.
Something went wrong with that request. Please try again.