E5F4 try to handle versioning on openbsd by tony · Pull Request #32 · tmux-python/libtmux · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libtmux/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import logging
import os
import re
import sys
import subprocess
from distutils.version import StrictVersion, LooseVersion

Expand Down Expand Up @@ -380,6 +381,12 @@ def is_version(version):
:rtype: bool

"""
if sys.platform.startswith("openbsd"):
if LooseVersion(version) > LooseVersion('2.1'):
return 'openbsd'
else:
return False

proc = tmux_cmd('-V')

if proc.stderr:
Expand All @@ -401,6 +408,9 @@ def has_required_tmux_version(version=None):
"""

if not version:
if sys.platform.startswith("openbsd"): # openbsd has no tmux -V
return '2.3'

proc = tmux_cmd('-V')

if proc.stderr:
Expand Down
0