Bruno Desthuilliers wrote:
Hari Sekhon wrote:I've got some code as follows: sorry, I know it looks like I was being stingy but the traceback was not that helpful, not without seeing more a huge amount more of the code. I was trying to abbreviate. Traceback (most recent call last): File "./backup.py", line 649, in ? backup(machine,share) File "./backup.py", line 364, in backup backupdir(source,destination) File "./backup.py", line 398, in backupdir (dirlist,filelist) = getdirlisting( source ) File "./backup.py", line 445, in getdirlisting if re_skip_dirs.match(x): UnboundLocalError: local variable 're_skip_dirs' referenced before assignment This doesn't really show that much, I figured the problem was the following: def getdirlisting(): re_skip_dirs = re_skip_top_dirs #Here's the culprit where both these regex compiled objects were declared at the top level, it seems that the assignment is trying to use the local variable re_skip_top_dirs which doesn't exist, that's why I'm getting a traceback, commenting out this line it runs fine. -h |
-- http://mail.python.org/mailman/listinfo/python-list
