nixpkgs/pkgs/development/python-modules/pyslurm/pyslurm-dlfcn.patch
2017-07-13 03:13:05 -04:00

18 lines
556 B
Diff

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 *