twint
twint copied to clipboard
version check has a bug
https://github.com/twintproject/twint/blob/e7c8a0c764f6879188e5c21e25fb6f1f856a7221/twint/cli.py#L335
twint raises an error that "TWINT requires Python version 3.6+" when you try to run it in Python 3.10 because the comparison casts the version as a float.
It would be better to take the version number as a tuple and compare it works with semantic versioning.
>>> (3, 10) > (3, 6)
True
I do this little change like you suggest @dmhowcroft and it seems to work:
--- cli.py.bkp 2022-01-15 10:23:22.172975710 +0100
+++ cli.py 2022-01-15 10:35:20.349681221 +0100
@@ -297,8 +297,7 @@ def main():
run.Search(c)
def run_as_command():
- version = ".".join(str(v) for v in sys.version_info[:2])
- if float(version) < 3.6:
+ if (sys.version_info.major, sys.version_info.minor) < (3, 6):
print("[-] TWINT requires Python version 3.6+.")
sys.exit(0)
I do this little change like you suggest @dmhowcroft and it seems to work:
--- cli.py.bkp 2022-01-15 10:23:22.172975710 +0100 +++ cli.py 2022-01-15 10:35:20.349681221 +0100 @@ -297,8 +297,7 @@ def main(): run.Search(c) def run_as_command(): - version = ".".join(str(v) for v in sys.version_info[:2]) - if float(version) < 3.6: + if (sys.version_info.major, sys.version_info.minor) < (3, 6): print("[-] TWINT requires Python version 3.6+.") sys.exit(0)
This one works for me.