UltimaHoarder / UltimaScraper

Scrape all the media from an OnlyFans account - Updated regularly
GNU General Public License v3.0
4.01k stars 608 forks source link

Support for Python 3.10 #1948

Closed symmetryaktion closed 1 year ago

symmetryaktion commented 2 years ago

On tests\main_test.py there's a function where it checks for python version. Sadly i was wondering, why there's a logic where it converts the version into float

PS C:\Users\Administrator\Downloads\Pan\OF\OnlyFans\tests> python
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> version_info = sys.version_info
>>> version_info
sys.version_info(major=3, minor=10, micro=6, releaselevel='final', serial=0)
>>> python_version = f"{version_info.major}.{version_info.minor}"
>>> python_version
'3.10'
>>> python_version = float(python_version)
>>> python_version
3.1
>>>

That way, it creates a warning:

Execute the script with Python 3.9

TweakBox commented 1 year ago

i fixed it up with this

def version_check():
    version_info = sys.version_info
    if version_info.major < 3 and version_info.minor < 9:
        string = f"Execute the script with Python 3.9, you are using {str(version_info.major)}.{str(version_info.minor)} \n"
        string += "Press enter to continue"
        input(string)
        exit(0)
# Updating any outdated config values