Ticket #2510: 0001-Fix-a-bug-in-config-typechecking.patch

File 0001-Fix-a-bug-in-config-typechecking.patch, 902 bytes (added by awknaust, 10 years ago)
  • deluge/config.py

    From 772260073b8245468f7d73c0b62fee041b6be920 Mon Sep 17 00:00:00 2001
    From: Alex Knaust <awknaust@gmail.com>
    Date: Sat, 27 Sep 2014 14:49:48 -0600
    Subject: [PATCH] Fix a bug in config typechecking
    
    ---
     deluge/config.py | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/deluge/config.py b/deluge/config.py
    index a59f922..def4b46 100644
    a b def set_item(self, key, value): 
    180180 
    181181        # Do not allow the type to change unless it is None 
    182182        oldtype, newtype = type(self.__config[key]), type(value) 
    183  
    184         if value is not None and not isinstance(oldtype, type(None)) and not isinstance(oldtype, newtype): 
     183        if value is not None and not oldtype == type(None) and not oldtype ==newtype: 
    185184            try: 
    186185                if oldtype == unicode: 
    187186                    value = oldtype(value, "utf8")