Merge pull request #33656 from veprbl/pyslurm_fix

pyslurm: bump to unbreak (master)
This commit is contained in:
Andreas Rammhold 2018-01-09 17:24:23 +00:00 committed by GitHub
commit 613383206c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 23 deletions

View file

@ -2,18 +2,16 @@
buildPythonPackage rec {
pname = "pyslurm";
version = "unstable-69e4f4f";
version = "20171102";
name = pname + "-" + version;
src = fetchFromGitHub {
repo = "pyslurm";
owner = "PySlurm";
rev = "69e4f4fd66003b98ddb7da25613fe641d4ae160d";
sha256 = "051kafkndbniklxyf0drb360aiblnqcf9rqjbvmqh66zrfya1m28";
rev = "a2acbc820da419e308c5817998d2abe78a7b75e6";
sha256 = "1wmlx5fh1xzjyksvmq7i083hmyvs7id61ysk2d9hbmf8rza498as";
};
patches = [ ./pyslurm-dlfcn.patch ];
buildInputs = [ cython slurm ];
setupPyBuildFlags = [ "--slurm-lib=${slurm}/lib" "--slurm-inc=${slurm.dev}/include" ];

View file

@ -1,18 +0,0 @@
diff --git a/pyslurm/__init__.py b/pyslurm/__init__.py
index 81643e1..e8b6836 100644
--- a/pyslurm/__init__.py
+++ b/pyslurm/__init__.py
@@ -11,8 +11,11 @@ import sys
old_dlopen_flags = ''
if hasattr(sys, "setdlopenflags"):
old_dlopen_flags = sys.getdlopenflags()
- import DLFCN
- sys.setdlopenflags(old_dlopen_flags | DLFCN.RTLD_GLOBAL)
+ if sys.version_info >= (3,6):
+ from os import RTLD_GLOBAL
+ else:
+ from DLFCN import RTLD_GLOBAL
+ sys.setdlopenflags(old_dlopen_flags | RTLD_GLOBAL)
from .pyslurm import *