[fiona] 03/12: Add patch to fix builtins ImportError with Python 2.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sun Feb 7 22:37:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository fiona.

commit ef73047510407fb00a5e81145db3810bfb98d710
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Oct 23 22:48:37 2015 +0200

    Add patch to fix builtins ImportError with Python 2.
---
 debian/changelog                   |  1 +
 debian/patches/0005-builtins.patch | 40 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series              |  1 +
 3 files changed, 42 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 34d22fe..9ac18c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ fiona (1.6.2-2) UNRELEASED; urgency=medium
   * Team upload.
   * Add patch for GDAL 2.0 support.
   * Add patch to not cythonize in the clean target.
+  * Add patch to fix builtins ImportError with Python 2.
 
  -- Bas Couwenberg <sebastic at debian.org>  Fri, 23 Oct 2015 21:50:46 +0200
 
diff --git a/debian/patches/0005-builtins.patch b/debian/patches/0005-builtins.patch
new file mode 100644
index 0000000..3c0cb07
--- /dev/null
+++ b/debian/patches/0005-builtins.patch
@@ -0,0 +1,40 @@
+Description: Use __builtin__ module for Python 2.
+ Fixes exception:
+  ImportError: No module named builtins
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/fiona/ogrext2.pyx
++++ b/fiona/ogrext2.pyx
+@@ -23,7 +23,11 @@ from fiona.rfc3339 import FionaDateType,
+ 
+ from libc.stdlib cimport malloc, free
+ from libc.string cimport strcmp
+-from builtins import int
++
++if sys.version_info > (3,):
++    from builtins import int
++else:
++    from __builtin__ import int
+ 
+ log = logging.getLogger("Fiona")
+ class NullHandler(logging.Handler):
+--- a/tests/test_props.py
++++ b/tests/test_props.py
+@@ -2,11 +2,16 @@ import json
+ import os.path
+ from six import text_type
+ import tempfile
++import sys
+ 
+ import fiona
+ from fiona import prop_type, prop_width
+ from fiona.rfc3339 import FionaDateType
+-from builtins import int
++
++if sys.version_info > (3,):
++    from builtins import int
++else:
++    from __builtin__ import int
+ 
+ def test_width_str():
+     assert prop_width('str:254') == 254
diff --git a/debian/patches/series b/debian/patches/series
index 7234788..32a349a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 0002-Remove-outside-reference-possible-privacy-breach.patch
 0003-GDAL-2.0.patch
 0004-clean-setup.patch
+0005-builtins.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/fiona.git



More information about the Pkg-grass-devel mailing list