Skip to content

Commit 578c0ab

Browse files
authored
BUG: Newer pylsl uses lib (#68)
1 parent ee7216a commit 578c0ab

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/automerge.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Bot auto-merge
2+
on: pull_request # yamllint disable-line rule:truthy
3+
4+
jobs:
5+
autobot:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
runs-on: ubuntu-latest
10+
# Names can be found with gh api /repos/mne-tools/mne-python/pulls/12998 -q .user.login for example
11+
if: (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'github-actions[bot]') && github.repository == 'mne-tools/mne-realtime'
12+
steps:
13+
- name: Enable auto-merge for bot PRs
14+
run: gh pr merge --auto --squash "$PR_URL"
15+
env:
16+
PR_URL: ${{github.event.pull_request.html_url}}
17+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

mne_realtime/lsl_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ def _connect(self):
124124
max_buflen=self.buffer_size)
125125
# Most ctypes can be converted to numpy dtypes.
126126
# Exceptions include c_char_p
127-
value_type = pylsl.pylsl.fmt2type[stream_info.channel_format()]
127+
try:
128+
from pylsl.lib import fmt2type # 1.17.6+
129+
except Exception:
130+
from pylsl.pylsl import fmt2type
131+
value_type = fmt2type[stream_info.channel_format()]
128132
if value_type == ctypes.c_char_p:
129133
value_type = None
130134
self.buffer = np.empty(

0 commit comments

Comments
 (0)