From 3b09e73e5801e33c8ccac6b524f5ca201f3be4eb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 Jan 2010 14:59:01 +0000 Subject: [PATCH] - bugfix (user supplied fix) [#20745] makesrna with rename error. - error with last commit, length had an index arg. --- release/scripts/modules/bpy/__init__.py | 1 - source/blender/makesrna/intern/makesrna.c | 3 +++ source/blender/makesrna/intern/rna_rna.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 96cd846d4b3..a6bb2921a34 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -70,7 +70,6 @@ def load_scripts(reload_scripts=False): reload(module) except: traceback.print_exc() - return None if reload_scripts: # reload modules that may not be directly included diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index f1f0510f7ec..fe9caf26e1b 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -51,12 +51,14 @@ static int replace_if_different(char *tmpfile) { #define REN_IF_DIFF \ + remove(orgfile); \ if(rename(tmpfile, orgfile) != 0) { \ fprintf(stderr, "%s:%d, rename error: \"%s\" -> \"%s\"\n", __FILE__, __LINE__, tmpfile, orgfile); \ return -1; \ } \ remove(tmpfile); \ return 1; \ +/* end REN_IF_DIFF */ FILE *fp_new, *fp_org; @@ -112,6 +114,7 @@ static int replace_if_different(char *tmpfile) REN_IF_DIFF; } else { + remove(tmpfile); return 0; } diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index a2a6e7c361c..51f0fe62722 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -799,7 +799,7 @@ static void rna_BlenderRNA_structs_begin(CollectionPropertyIterator *iter, Point } /* optional, for faster lookups */ -static int rna_BlenderRNA_structs_length(PointerRNA *ptr, int index) +static int rna_BlenderRNA_structs_length(PointerRNA *ptr) { return BLI_countlist(&((BlenderRNA*)ptr->data)->structs); }