Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

When `GEOSFree` is not available on NT platforms, have to specificall…

…y use the MS C library.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12024 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2b9d216ffc26834968ec7600a7ae194f0b227318 1 parent a488589
Justin Bronn authored December 29, 2009
9  django/contrib/gis/geos/prototypes/errcheck.py
... ...
@@ -1,6 +1,7 @@
1 1
 """
2 2
  Error checking functions for GEOS ctypes prototype functions.
3 3
 """
  4
+import os
4 5
 from ctypes import c_void_p, string_at, CDLL
5 6
 from django.contrib.gis.geos.error import GEOSException
6 7
 from django.contrib.gis.geos.libgeos import lgeos, GEOS_VERSION
@@ -15,8 +16,12 @@
15 16
     free.restype = None
16 17
 else:
17 18
     # Getting the `free` routine from the C library of the platform.
18  
-    # The C library is obtained by passing None into `CDLL`.
19  
-    libc = CDLL(None)
  19
+    if os.name == 'nt':
  20
+        # On NT, use the MS C library.
  21
+        libc = CDLL('msvcrt')
  22
+    else:
  23
+        # On POSIX platforms C library is obtained by passing None into `CDLL`.
  24
+        libc = CDLL(None)
20 25
     free = libc.free
21 26
 
22 27
 ### ctypes error checking routines ###

0 notes on commit 2b9d216

Please sign in to comment.
Something went wrong with that request. Please try again.