Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
Justin Bronn authored
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 30c6021

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