diff --git a/src/common.py b/src/common.py index 205b3a24d..6a6adba7b 100644 --- a/src/common.py +++ b/src/common.py @@ -35,8 +35,11 @@ PROGRAM_NAME = "Deluge" PROGRAM_VERSION = "0.5.3" CLIENT_CODE = "DE" -CLIENT_VERSION = "".join(PROGRAM_VERSION.split('.'))+"0"*(4 - len(PROGRAM_VERSION.split('.'))) - +CLIENT_VERSION = ''.join(PROGRAM_VERSION.split('.')) +if len(CLIENT_VERSION) < 4: + CLIENT_VERSION = CLIENT_VERSION + '0'*(4-len(CLIENT_VERSION)) +elif len(CLIENT_VERSION) > 4: + CLIENT_VERSION = CLIENT_VERSION[:4] CONFIG_DIR = xdg.BaseDirectory.save_config_path('deluge') # the necessary substitutions are made at installation time diff --git a/src/core.py b/src/core.py index 40a7d3016..6cb34ed0c 100644 --- a/src/core.py +++ b/src/core.py @@ -188,7 +188,7 @@ class Manager: InvalidTorrentError) # Start up the core - assert(len(version) == 5) + assert(len(version) == 4) deluge_core.init(client_ID, int(version[0]), int(version[1]),