Skip to content

Commit d7bd036

Browse files
authored
Merge pull request #28 from jxngao/master
fix example error on windows
2 parents cea7bc4 + 787e075 commit d7bd036

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

examples/lsload.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pythonlsf import lsf
22
import ctypes
3+
import platform
34

45
def printHostInfo():
56
if lsf.lsb_init("test") > 0:
@@ -15,8 +16,11 @@ def printHostInfo():
1516

1617
for i in range(nhosts) :
1718
host = all_lsload_data[i]
18-
hostname = ctypes.cast( host.hostName, ctypes.c_char_p)
19-
print('No.{} host name : {}'.format(i, hostname.value))
19+
if platform.system() == 'Windows':
20+
print('No.{} host name : {}'.format(i, host.hostName))
21+
else:
22+
hostname = ctypes.cast( host.hostName, ctypes.c_char_p)
23+
print('No.{} host name : {}'.format(i, hostname.value))
2024

2125
return 0
2226

winbuild/build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ msbuild lsf.sln -property:Configuration=Release
33
cp X64\Release\_lsf.pyd ..\pythonlsf\
44
cp X64\Release\_lsf.lib ..\pythonlsf\
55
cp X64\Release\_lsf.exp ..\pythonlsf\
6+
cp %LSF_LIB%\liblsbstream.dll ..\pythonlsf\
67

78

0 commit comments

Comments
 (0)