Skip to content

Commit c64294e

Browse files
committed
Remove debug prints
1 parent afc914b commit c64294e

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

IsoSpecPy/isoFFI.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
if False:
77
import IsoSpecCppPy
88

9-
def dprint(*args):
10-
print(*args, file=sys.stderr, flush=True)
11-
print(*args, flush=True)
12-
139
class IsoFFI:
1410
def __init__(self):
1511
self.ffi = cffi.FFI()
@@ -144,8 +140,6 @@ def __init__(self):
144140
''');
145141

146142
mod_dir = Path(__file__).resolve().parent
147-
dprint("mod_dir:", mod_dir)
148-
dprint("mod_dir parent content recursive tree:", list(mod_dir.parent.rglob('*')))
149143

150144
if (mod_dir.parent / 'setup.py').exists():
151145
raise ImportError('''Attempted to load IsoSpecPy module from its build directory. This usually
@@ -163,40 +157,30 @@ def __init__(self):
163157
except:
164158
pass
165159

166-
dprint("Looking for libIsoSpec++.so in", mod_dir)
167-
dprint("Library name patterns:", libnames)
168-
dprint("Library prefix patterns:", libprefix)
169-
dprint("Library extension patterns:", extension)
170-
171160
prebuilt = ['', 'prebuilt-']
172161

173162
def cprod(ll1, ll2):
174163
res = []
175164
for l1 in ll1:
176165
for l2 in ll2:
177166
res.append(l1+l2)
178-
dprint("cprod:", ll1, ll2, "->", res)
179167
return res
180168

181169
paths_to_check = cprod(prebuilt, cprod(libprefix, cprod(libnames, extension)))
182-
dprint("Constructed paths to check:", paths_to_check)
183170
dpc = []
184171

185172
for dirpath in [mod_dir, mod_dir.parent, mod_dir.parent / 'bin', mod_dir.parent / 'lib']:
186173
dpc.extend([dirpath / p for p in paths_to_check])
187174

188175
paths_to_check = dpc
189-
dprint("Final paths to check before globbing:", paths_to_check)
190176
# expand glob patterns using pathlib (keep only actual matches, like glob.glob did)
191177
expanded = []
192178
for p in paths_to_check:
193179
expanded.extend(p.parent.glob(p.name))
194180
paths_to_check = expanded
195-
dprint("Final paths to check after globbing:", paths_to_check)
196181
try:
197182
import importlib
198183
paths_to_check.insert(0, Path(importlib.util.find_spec("IsoSpecCppPy").origin))
199-
dprint("Also trying to load IsoSpecCppPy from:", paths_to_check[0])
200184
except (ImportError, AttributeError):
201185
pass
202186

@@ -205,10 +189,8 @@ def cprod(ll1, ll2):
205189
self.clib = None
206190
for libpath in set(paths_to_check):
207191
try:
208-
dprint("Trying to load libIsoSpec++.so from:", libpath)
209192
self.clib = self.ffi.dlopen(str(libpath))
210193
self.libpath = libpath
211-
dprint("Successfully loaded libIsoSpec++.so from:", libpath)
212194
break
213195
except (IndexError, OSError) as e:
214196
errmsg = "Load libIsoSpec++.so, tried: " + libpath + '\n' + "Got error: " + str(type(e)) + ": " + str(e)

0 commit comments

Comments
 (0)