You can subscribe to this list here.
2002 |
Jan
|
Feb
(5) |
Mar
(352) |
Apr
(154) |
May
(14) |
Jun
(29) |
Jul
(9) |
Aug
(11) |
Sep
(60) |
Oct
(3) |
Nov
|
Dec
(27) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(17) |
Feb
(11) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(22) |
Dec
(1) |
2004 |
Jan
|
Feb
|
Mar
(21) |
Apr
|
May
(8) |
Jun
(22) |
Jul
(8) |
Aug
|
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(12) |
2005 |
Jan
|
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(17) |
Sep
(32) |
Oct
(22) |
Nov
(15) |
Dec
|
2006 |
Jan
(5) |
Feb
(8) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(1) |
Nov
(6) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(14) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(70) |
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(71) |
Jul
(1) |
Aug
|
Sep
(28) |
Oct
(8) |
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(83) |
2011 |
Jan
(192) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: ferry j. <fer...@mo...> - 2011-10-19 19:01:33
|
Hi all, I test quickly pychecker to improve my code on several projects. First of all, i test a gimp plugin where i use yaml config file. For this, i can't use pychecker on the traditionnal command line but like this : import yaml import other_libs ... import pychecker.checker import myproject the trackback result : Traceback (most recent call last): File "/home/jferry/.gimp-2.6/plug-ins/multi_export.py", line 134, in validate serialize = load(open(self.config_chooser.get_filename())) File "/usr/lib/python2.6/dist-packages/yaml/__init__.py", line 58, in load return loader.get_single_data() File "/usr/lib/python2.6/dist-packages/yaml/constructor.py", line 44, in get_single_data return self.construct_document(node) File "/usr/lib/python2.6/dist-packages/yaml/constructor.py", line 53, in construct_document for dummy in generator: File "/usr/lib/python2.6/dist-packages/yaml/constructor.py", line 403, in construct_yaml_map value = self.construct_mapping(node) File "/usr/lib/python2.6/dist-packages/yaml/constructor.py", line 213, in construct_mapping return BaseConstructor.construct_mapping(self, node, deep=deep) File "/usr/lib/python2.6/dist-packages/yaml/constructor.py", line 132, in construct_mapping key = self.construct_object(key_node, deep=deep) File "/usr/lib/python2.6/dist-packages/yaml/constructor.py", line 93, in construct_object data = constructor(self, node) File "/usr/lib/python2.6/dist-packages/yaml/constructor.py", line 391, in construct_yaml_str return value.encode('ascii') File "/usr/lib/python2.6/encodings/__init__.py", line 100, in search_function level=0) TypeError: __import__() got an unexpected keyword argument 'level' I found a solution with this attach patch. I don't no if it's the best and clean way but it works and it's already quite for me. Thanks for objective suggestion. Regards -- *Jérémie Ferry* 52, rue de Lorraine 54500 Vandoeuvre-les-Nancy _Mobile :_ *06 60 17 74 03* |
From: Thomas V. S. <tho...@us...> - 2011-04-27 19:51:40
|
Update of /cvsroot/pychecker/pychecker In directory vz-cvs-2.sog:/tmp/cvs-serv22461 Modified Files: ChangeLog setup.py Log Message: patch by: Arfrever Frehtes Taifersar Arahesis * setup.py: Make sure we close the file so it gets written. Index: setup.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/setup.py,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- setup.py 8 Jan 2011 11:55:57 -0000 1.70 +++ setup.py 27 Apr 2011 19:51:36 -0000 1.71 @@ -221,7 +221,9 @@ script_str = "%s %s %%*\n" % (sys.executable, checker_path) else: script_str = '#! /bin/sh\n\n%s %s "$@"\n' % (sys.executable, checker_path) - open(script_path, "w").write(script_str) + handle = open(script_path, "w") + handle.write(script_str) + handle.close() except Exception, e: print "ERROR: Unable to create %s: %s" % (script_path, e) raise e Index: ChangeLog =================================================================== RCS file: /cvsroot/pychecker/pychecker/ChangeLog,v retrieving revision 1.148 retrieving revision 1.149 diff -u -d -r1.148 -r1.149 --- ChangeLog 25 Jan 2011 11:39:59 -0000 1.148 +++ ChangeLog 27 Apr 2011 19:51:36 -0000 1.149 @@ -1,3 +1,10 @@ +2011-04-27 Thomas Vander Stichele <thomas at apestaart dot org> + + patch by: Arfrever Frehtes Taifersar Arahesis + + * setup.py: + Make sure we close the file so it gets written. + 2011-01-25 Thomas Vander Stichele <thomas at apestaart dot org> * pychecker/Stack.py: |
From: Thomas V. S. <tho...@us...> - 2011-01-25 11:40:11
|
Update of /cvsroot/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv5451 Modified Files: ChangeLog Log Message: * pychecker/Stack.py: Document isMethodCall. Add a FIXME for the fact that we're not checking at all if the item really represents a method known to the classObject passed. It breaks test 69 which does __init__ aliasing. * pychecker/pcmodules.py: Document Class better. Add an assert to make sure that we add by the real name of the method. Index: ChangeLog =================================================================== RCS file: /cvsroot/pychecker/pychecker/ChangeLog,v retrieving revision 1.147 retrieving revision 1.148 diff -u -d -r1.147 -r1.148 --- ChangeLog 25 Jan 2011 10:32:24 -0000 1.147 +++ ChangeLog 25 Jan 2011 11:39:59 -0000 1.148 @@ -1,5 +1,17 @@ 2011-01-25 Thomas Vander Stichele <thomas at apestaart dot org> + * pychecker/Stack.py: + Document isMethodCall. + Add a FIXME for the fact that we're not checking at all if the + item really represents a method known to the classObject passed. + It breaks test 69 which does __init__ aliasing. + * pychecker/pcmodules.py: + Document Class better. + Add an assert to make sure that we add by the real name of the + method. + +2011-01-25 Thomas Vander Stichele <thomas at apestaart dot org> + * HACKING: Add debian note. * pychecker/CodeChecks.py: |
From: Thomas V. S. <tho...@us...> - 2011-01-25 11:40:09
|
Update of /cvsroot/pychecker/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv5451/pychecker Modified Files: Stack.py pcmodules.py Log Message: * pychecker/Stack.py: Document isMethodCall. Add a FIXME for the fact that we're not checking at all if the item really represents a method known to the classObject passed. It breaks test 69 which does __init__ aliasing. * pychecker/pcmodules.py: Document Class better. Add an assert to make sure that we add by the real name of the method. Index: pcmodules.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/pcmodules.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- pcmodules.py 18 Jan 2011 07:42:28 -0000 1.19 +++ pcmodules.py 25 Jan 2011 11:39:59 -0000 1.20 @@ -113,7 +113,7 @@ or because the module this class comes from is blacklisted. @type ignoreAttrs: int (used as bool) - @type methods: dict + @type methods: dict of str -> None or L{Function} @type members: dict of str -> type @type memberRefs: dict @type statics: dict @@ -211,6 +211,8 @@ def addMethod(self, methodName, method=None): """ Add the given method to this class by name. + The name is the real name of the method, not an alias; ie the name of + the method as defined in the code. @type methodName: str @type method: method or None @@ -218,6 +220,7 @@ if not method: self.methods[methodName] = None else : + assert method.func_name == methodName self.methods[methodName] = function.Function(method, 1) def addMethods(self, classObject): Index: Stack.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/Stack.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Stack.py 25 Jan 2011 10:32:24 -0000 1.28 +++ Stack.py 25 Jan 2011 11:39:59 -0000 1.29 @@ -73,11 +73,12 @@ def isImplicitNone(self) : return self.data is None and self.const - def isMethodCall(self, c, methodArgName): + def isMethodCall(self, classObject, methodArgName): """ - @param methodArgName: the first argument Check if the stack item is a method call. + @type classObject: L{pychecker.PCModules.Class} or None + @param classObject: the class object to check against @type methodArgName: str @param methodArgName: the name of the first argument for method calls; usually self. @@ -85,9 +86,9 @@ if self.type != TYPE_ATTRIBUTE: return False - # FIXME: we only check if c is not None; that doesn't mean it + # FIXME: we only check if classObject is not None; that doesn't mean it # has the given methodArgName - if c is None: + if classObject is None: return False if len(self.data) != 2: @@ -98,6 +99,14 @@ # indirection does not start with first argument for method calls return False + # FIXME: this check was not happening before; so before it was counting + # object attributes as methods always + if self.data[1] not in classObject.methods: + # FIXME: for now implement previous behaviour, but fix it to return + # False + return True + # return False + return True def isLocals(self): |
From: Thomas V. S. <tho...@us...> - 2011-01-25 10:32:34
|
Update of /cvsroot/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv23632 Modified Files: ChangeLog HACKING Log Message: * HACKING: Add debian note. * pychecker/CodeChecks.py: Add a FIXME for an internal warning. * pychecker/Stack.py: Comment, document, and assert assumptions related to attributes and indirections. Index: HACKING =================================================================== RCS file: /cvsroot/pychecker/pychecker/HACKING,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- HACKING 8 Jan 2011 21:22:07 -0000 1.9 +++ HACKING 25 Jan 2011 10:32:24 -0000 1.10 @@ -69,3 +69,7 @@ BUILDBOT -------- A buildbot is set up at http://build.fluendo.com:8200/ + +PACKAGES +-------- +- debian page: http://packages.qa.debian.org/p/pychecker.html Index: ChangeLog =================================================================== RCS file: /cvsroot/pychecker/pychecker/ChangeLog,v retrieving revision 1.146 retrieving revision 1.147 diff -u -d -r1.146 -r1.147 --- ChangeLog 21 Jan 2011 11:51:19 -0000 1.146 +++ ChangeLog 25 Jan 2011 10:32:24 -0000 1.147 @@ -1,3 +1,13 @@ +2011-01-25 Thomas Vander Stichele <thomas at apestaart dot org> + + * HACKING: + Add debian note. + * pychecker/CodeChecks.py: + Add a FIXME for an internal warning. + * pychecker/Stack.py: + Comment, document, and assert assumptions related to + attributes and indirections. + 2011-01-21 Thomas Vander Stichele <thomas at apestaart dot org> * test/input/nestedinit.py: |
From: Thomas V. S. <tho...@us...> - 2011-01-25 10:32:33
|
Update of /cvsroot/pychecker/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv23632/pychecker Modified Files: CodeChecks.py Stack.py Log Message: * HACKING: Add debian note. * pychecker/CodeChecks.py: Add a FIXME for an internal warning. * pychecker/Stack.py: Comment, document, and assert assumptions related to attributes and indirections. Index: CodeChecks.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/CodeChecks.py,v retrieving revision 1.227 retrieving revision 1.228 diff -u -d -r1.227 -r1.228 --- CodeChecks.py 25 Jan 2011 08:44:45 -0000 1.227 +++ CodeChecks.py 25 Jan 2011 10:32:24 -0000 1.228 @@ -1561,6 +1561,7 @@ def _LOAD_ATTR(oparg, operand, codeSource, code) : # FIXME: how can LOAD_ATTR happen without a stack ? + # FIXME: add an internal warning here if len(code.stack) > 0 : top = code.stack[-1] _checkAttribute(top, operand, codeSource, code) Index: Stack.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/Stack.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Stack.py 9 Jan 2011 17:19:43 -0000 1.27 +++ Stack.py 25 Jan 2011 10:32:24 -0000 1.28 @@ -21,6 +21,8 @@ TYPE_GLOBAL = "-global-" TYPE_EXCEPT = "-except-" +# conventions for Items: +# a method call has data ('self', methodName), type ATTRIBUTE class Item: """ Representation of data on the stack @@ -72,8 +74,31 @@ return self.data is None and self.const def isMethodCall(self, c, methodArgName): - return self.type == TYPE_ATTRIBUTE and c != None and \ - len(self.data) == 2 and self.data[0] == methodArgName + """ + @param methodArgName: the first argument + Check if the stack item is a method call. + + @type methodArgName: str + @param methodArgName: the name of the first argument for method calls; + usually self. + """ + if self.type != TYPE_ATTRIBUTE: + return False + + # FIXME: we only check if c is not None; that doesn't mean it + # has the given methodArgName + if c is None: + return False + + if len(self.data) != 2: + # no object indirection happening + return False + + if self.data[0] != methodArgName: + # indirection does not start with first argument for method calls + return False + + return True def isLocals(self): return self.type == types.DictType and self.data == LOCALS @@ -111,6 +136,8 @@ return TYPE_UNKNOWN def getName(self): + # if the item is an attribute but not a string, it's a tuple + # of object indirections if self.type == TYPE_ATTRIBUTE and type(self.data) != types.StringType: strValue = "" # convert the tuple into a string ('self', 'data') -> self.data @@ -120,10 +147,27 @@ return utils.safestr(self.data) def addAttribute(self, attr): - if type(self.data) == types.TupleType: - self.data = self.data + (attr,) - else: - self.data = (self.data, attr) + """ + Replaces self with a stack item representing the dereferencing of + its attribute. + + For example, if the stack item describes a class, calling this method + will replace the stack item with one describing the attribute of + this class. + + @type attr: str + """ + # only called through LOAD_ATTR, which replaces TOS with the + # dereferencing result + assert type(attr) is str + + # make sure that adding an attribute makes data a tuple if it + # wasn't yet + if type(self.data) != types.TupleType: + self.data = (self.data, ) + + self.data = self.data + (attr,) + self.type = TYPE_ATTRIBUTE |
From: Thomas V. S. <tho...@us...> - 2011-01-25 08:44:57
|
Update of /cvsroot/pychecker/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30655/pychecker Modified Files: CodeChecks.py Log Message: pep8, more docs, and more naming consistency Index: CodeChecks.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/CodeChecks.py,v retrieving revision 1.226 retrieving revision 1.227 diff -u -d -r1.226 -r1.227 --- CodeChecks.py 21 Jan 2011 11:00:18 -0000 1.226 +++ CodeChecks.py 25 Jan 2011 08:44:45 -0000 1.227 @@ -207,7 +207,7 @@ if arg not in info[3]: code.addWarning(msgs.FUNC_DOESNT_SUPPORT_KW_ARG % (func_name, arg)) -def _checkBuiltin(code, loadValue, argCount, kwArgs, check_arg_count = 1) : +def _checkBuiltin(code, loadValue, argCount, kwArgs, checkArgCount = 1) : returnValue = Stack.makeFuncReturnValue(loadValue, argCount) func_name = loadValue.data if loadValue.type == Stack.TYPE_GLOBAL : @@ -227,7 +227,7 @@ if kwArgs: _validateKwArgs(code, info, func_name, kwArgs) - elif check_arg_count : + elif checkArgCount : _checkFunctionArgCount(code, func_name, argCount, info[1], info[2]) returnValue = Stack.Item(returnValue.data, info[0]) @@ -238,7 +238,7 @@ try : if func_name[1] == 'append' and argCount > 1 : code.addWarning(msgs.LIST_APPEND_ARGS % func_name[0]) - check_arg_count = 0 + checkArgCount = 0 except AttributeError : # FIXME: why do we need to catch AttributeError??? pass @@ -253,7 +253,7 @@ elif methodInfo : returnValue = Stack.Item(func_name[1], methodInfo[0]) returnValue.setStringType(methodInfo[0]) - if check_arg_count and methodInfo is not None : + if checkArgCount and methodInfo is not None : _checkFunctionArgCount(code, func_name[1], argCount, methodInfo[1], methodInfo[2]) @@ -364,11 +364,18 @@ if err: code.addWarning(err) -def _handleFunctionCall(codeSource, code, argCount, indexOffset = 0, - check_arg_count = 1) : - 'Checks for warnings, returns function called (may be None)' +def _handleFunctionCall(codeSource, code, argCount, indexOffset=0, + checkArgCount=1): + """ + Checks the function call for warnings. + Replaces the function call on the stack with an Item representing + the return value. + """ - if not code.stack : + # without a stack, we cannot construct the call + if not code.stack: + code.addWarning(msgs.Internal( + "handling function call without a stack. File a bug.")) return kwArgCount = argCount >> utils.VAR_ARGS_BITS @@ -400,7 +407,7 @@ if m != None : objRef = not m.isStaticMethod() _checkFunctionArgs(code, m, objRef, argCount, kwArgs, - check_arg_count) + checkArgCount) except KeyError : sattr = codeSource.classObject.statics.get(methodName) if sattr is not None : @@ -446,7 +453,7 @@ if refClass and func.isClassMethod(): argCount = argCount + 1 _checkFunctionArgs(code, func, method, argCount, kwArgs, - check_arg_count) + checkArgCount) # if this isn't a c'tor, we should check if not (refClass and method) and cfg().checkReturnValues: _checkReturnValueUse(code, func) @@ -473,7 +480,7 @@ code.addWarning(msgs.NO_CTOR_ARGS) else : returnValue = _checkBuiltin(code, loadValue, argCount, kwArgs, - check_arg_count) + checkArgCount) if returnValue.type is types.NoneType and \ not OP.POP_TOP(code.nextOpInfo()[0]) : name = utils.safestr(loadValue.data) |
From: Kenneth J. P. <pro...@us...> - 2011-01-22 04:19:07
|
Update of /cvsroot/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9173 Modified Files: MANIFEST.in Log Message: Update MANIFEST.in to generate an sdist more similar to releases prior to 0.8.19 Index: MANIFEST.in =================================================================== RCS file: /cvsroot/pychecker/pychecker/MANIFEST.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- MANIFEST.in 8 Jan 2011 11:28:03 -0000 1.4 +++ MANIFEST.in 22 Jan 2011 04:18:55 -0000 1.5 @@ -1,2 +1,20 @@ -include COPYRIGHT VERSION ChangeLog KNOWN_BUGS MAINTAINERS NEWS TODO pychecker.doap -include README pycheckrc +include setup.py +include setup.cfg +include ChangeLog +include COPYRIGHT +include HACKING +include KNOWN_BUGS +include MAINTAINERS +include NEWS +include README +include TODO +include VERSION +include pychecker.doap +include pycheckrc +include test_check.sh +recursive-include pychecker *.py +graft pychecker2 +graft test +graft test_input +graft test_expected +global-exclude .cvsignore *.pyc |
From: Thomas V. S. <tho...@us...> - 2011-01-21 19:53:58
|
Update of /cvsroot/pychecker/pychecker/doc In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv23829/doc Modified Files: release Log Message: add debian and fedora maintainers Index: release =================================================================== RCS file: /cvsroot/pychecker/pychecker/doc/release,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- release 21 Jan 2011 19:08:48 -0000 1.3 +++ release 21 Jan 2011 19:53:47 -0000 1.4 @@ -39,7 +39,7 @@ FIXME: Neil to give me admin ? moap doap -v $VERSION freshmeat -b Default - send out release mail: - moap doap -v $VERSION mail -f th...@ap... pyc...@li... + moap doap -v $VERSION mail -f th...@ap... pyc...@li... vcr...@re... pro...@de... - add new group to sourceforge and make it the default (FIXME: does default work ?) - update the homepage rsync -arv thomasvs,pyc...@we...: . |
From: Thomas V. S. <tho...@us...> - 2011-01-21 19:08:58
|
Update of /cvsroot/pychecker/pychecker/doc In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv13115/doc Modified Files: release Log Message: add testing notes Index: release =================================================================== RCS file: /cvsroot/pychecker/pychecker/doc/release,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- release 8 Jan 2011 21:20:28 -0000 1.2 +++ release 21 Jan 2011 19:08:48 -0000 1.3 @@ -1,3 +1,11 @@ +Before releasing +---------------- + +- ./test_check.sh +- trial test +- pychecker /usr/lib/python*/site-packages/pychecker/*.py +- pychecker flumotion, moap, morituri, savon + Release procedure for pychecker ------------------------------- |
From: Thomas V. S. <tho...@us...> - 2011-01-21 11:51:28
|
Update of /cvsroot/pychecker/pychecker/test/input In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28079/test/input Added Files: nestedinit.py Log Message: * test/input/nestedinit.py: Add another test case that triggers the wrong warnings. --- NEW FILE: nestedinit.py --- # -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 class Foo(property): USE_PRIVATE = "usePrivate" def __init__(self, name, fget=USE_PRIVATE, fset=USE_PRIVATE, fdel=USE_PRIVATE, defaultVal=None, descrip=None): privateName = '_'+name if fget == self.USE_PRIVATE: def f(obj): if not obj.__dict__.has_key(privateName): obj.__dict__[privateName] = copy.deepcopy(defaultVal) return obj.__dict__[privateName] fget = f # other code omitted here (sets up 'fset' and 'fdel') super(SvtAttr, self).__init__(fget, fset, fdel, descrip) |
From: Thomas V. S. <tho...@us...> - 2011-01-21 11:51:28
|
Update of /cvsroot/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28079 Modified Files: ChangeLog Log Message: * test/input/nestedinit.py: Add another test case that triggers the wrong warnings. Index: ChangeLog =================================================================== RCS file: /cvsroot/pychecker/pychecker/ChangeLog,v retrieving revision 1.145 retrieving revision 1.146 diff -u -d -r1.145 -r1.146 --- ChangeLog 21 Jan 2011 11:08:39 -0000 1.145 +++ ChangeLog 21 Jan 2011 11:51:19 -0000 1.146 @@ -1,5 +1,10 @@ 2011-01-21 Thomas Vander Stichele <thomas at apestaart dot org> + * test/input/nestedinit.py: + Add another test case that triggers the wrong warnings. + +2011-01-21 Thomas Vander Stichele <thomas at apestaart dot org> + * pychecker/check.py: Don't add None to sys.path |
From: Thomas V. S. <tho...@us...> - 2011-01-21 11:08:47
|
Update of /cvsroot/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21456 Modified Files: ChangeLog Log Message: * pychecker/check.py: Don't add None to sys.path Index: ChangeLog =================================================================== RCS file: /cvsroot/pychecker/pychecker/ChangeLog,v retrieving revision 1.144 retrieving revision 1.145 diff -u -d -r1.144 -r1.145 --- ChangeLog 21 Jan 2011 11:00:18 -0000 1.144 +++ ChangeLog 21 Jan 2011 11:08:39 -0000 1.145 @@ -1,5 +1,10 @@ 2011-01-21 Thomas Vander Stichele <thomas at apestaart dot org> + * pychecker/check.py: + Don't add None to sys.path + +2011-01-21 Thomas Vander Stichele <thomas at apestaart dot org> + * pychecker/CodeChecks.py: Handle sibling imports, where a module could be importing another living in the same directory. |
From: Thomas V. S. <tho...@us...> - 2011-01-21 11:08:47
|
Update of /cvsroot/pychecker/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21456/pychecker Modified Files: check.py Log Message: * pychecker/check.py: Don't add None to sys.path Index: check.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/check.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- check.py 21 Jan 2011 11:00:18 -0000 1.3 +++ check.py 21 Jan 2011 11:08:39 -0000 1.4 @@ -60,7 +60,8 @@ Returns a list of (module name, dirPath) that can be imported, where dirPath is the on-disk path to the module name for that argument. - dirPath can be None (in case the given argument is an actual module). + dirPath can be None (in case the given argument is an actual module name + importable as is). """ new_arguments = [] @@ -221,7 +222,8 @@ # create and load the PyCheckerModule, tricking sys.path temporarily oldsyspath = sys.path[:] - sys.path.insert(0, moduleDir) + if moduleDir is not None: + sys.path.insert(0, moduleDir) pcmodule = pcmodules.PyCheckerModule(moduleName, moduleDir=moduleDir) loaded = pcmodule.load() sys.path = oldsyspath |
From: Thomas V. S. <tho...@us...> - 2011-01-21 11:00:27
|
Update of /cvsroot/pychecker/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20149/pychecker Modified Files: CodeChecks.py check.py checker.py Log Message: * pychecker/CodeChecks.py: Handle sibling imports, where a module could be importing another living in the same directory. When handling IMPORT_NAME, pass the current's module moduleDir as the sibling module dir so we can load the ones that are as such, and tag them properly in the PCModules. * pychecker/check.py: Track both PC Modules and normal python modules added/loaded after importing all files to be checked. Delete the modules that are likely to be a sibling module from sys.modules, because they pollute that namespace by pretending they are an importable module from sys.path when they were a side effect of loading the files we were interested in. * pychecker/checker.py: Find a good moduleDir for the candidate files. * test/test_internal.py: Allow PYCHECKER_DEBUG as an env var so runs of trial can be done with debugging. Fix variables assert. Test now passes. Index: checker.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/checker.py,v retrieving revision 1.135 retrieving revision 1.136 diff -u -d -r1.135 -r1.136 --- checker.py 13 Jan 2011 12:25:08 -0000 1.135 +++ checker.py 21 Jan 2011 11:00:18 -0000 1.136 @@ -189,7 +189,18 @@ if check : try : # FIXME: can we find a good moduleDir ? - module = pcmodules.PyCheckerModule(pymodule.__name__) + # based on possible module.__file__, check if it's from + # sys.path, and if not, extract moduleDir + moduleDir = os.path.dirname(pymodule.__file__) + for path in sys.path: + if os.path.abspath(moduleDir) == os.path.abspath(path): + moduleDir = None + break + + # FIXME: could it possibly be from a higher-level package, + # instead of the current dir ? Loop up with __init__.py ? + module = pcmodules.PyCheckerModule(pymodule.__name__, + moduleDir=moduleDir) if module.initModule(pymodule): warnings = warn.find([module], _cfg, _suppressions) _printWarnings(_get_unique_warnings(warnings)) Index: CodeChecks.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/CodeChecks.py,v retrieving revision 1.225 retrieving revision 1.226 diff -u -d -r1.225 -r1.226 --- CodeChecks.py 21 Jan 2011 10:33:32 -0000 1.225 +++ CodeChecks.py 21 Jan 2011 11:00:18 -0000 1.226 @@ -735,10 +735,13 @@ else: fullName = "%s.%s" % (moduleName, operand) - try: - pcmodule = _getOrLoadPCModule(code, fullName, moduleDir) - code.pushStack(Stack.Item(pcmodule, types.ModuleType)) - except ImportError: + # see if the module we are importing from has the operand as a module + siblingModuleDir = module.moduleDir + pcmodule = _getOrLoadPCModule(code, moduleName, moduleDir, + siblingModuleDir=siblingModuleDir) + if operand in pcmodule.modules: + code.pushStack(Stack.Item(pcmodule.modules[operand], types.ModuleType)) + else: # FIXME: so what is it ? what do we push ? # For now, emulate the old code code.pushStack(Stack.Item(operand, types.ModuleType)) @@ -1693,7 +1696,7 @@ _checkNoEffect(code) -def _getOrLoadPCModule(code, name, moduleDir=None): +def _getOrLoadPCModule(code, name, moduleDir=None, siblingModuleDir=None): """ Retrieve a previously loaded PyChecker module by name, or load it. @@ -1705,23 +1708,40 @@ @rtype: L{pcmodules.PyCheckerModule} """ assert '*' not in name, "Name %r contains an asterisk" % name + + # make system imports take precedence over siblings + # FIXME: not sure what Python actually does here + # but reversing breaks the test_zope_interface test + pcmodule = pcmodules.getPCModule(name, moduleDir=moduleDir) + + if not pcmodule: + pcmodule = pcmodules.getPCModule(name, moduleDir=siblingModuleDir) + if not pcmodule: pcmodule = pcmodules.PyCheckerModule(name, moduleDir=moduleDir) try: pcmodule.load(allowImportError=True) except ImportError, e: - if not _handleDeprecated(code, name): - raise e + pcmodule = pcmodules.PyCheckerModule(name, + moduleDir=siblingModuleDir) + try: + pcmodule.load(allowImportError=True) + except ImportError, e: + if not _handleDeprecated(code, name): + raise e else: pass return pcmodule - def _IMPORT_NAME(oparg, operand, codeSource, code): try: - pcmodule = _getOrLoadPCModule(code, operand) + # FIXME: if it is a sibling import, we should reuse moduleDir + # FIXME: but should only be a candidate, and here we pass it always + siblingModuleDir = codeSource.module.moduleDir + pcmodule = _getOrLoadPCModule(code, operand, + siblingModuleDir=siblingModuleDir) code.pushStack(Stack.Item(pcmodule, types.ModuleType)) except ImportError: # TODO: a submodule could import a same-level module Index: check.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/check.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- check.py 13 Jan 2011 22:38:19 -0000 1.2 +++ check.py 21 Jan 2011 11:00:18 -0000 1.3 @@ -96,7 +96,7 @@ return modules -def getAllModules(): +def getAllPCModules(): """ Returns a list of all modules that should be checked. @@ -242,20 +242,42 @@ def getWarnings(files, cfg = None, suppressions = None): warnings = processFiles(files, cfg) fixupBuiltinModules() - return warnings + warn.find(getAllModules(), _cfg, suppressions) + return warnings + warn.find(getAllPCModules(), _cfg, suppressions) def _print_processing(name) : if not _cfg.quiet : sys.stderr.write("Processing %s...\n" % name) +def _mightBeSiblingModule(module): + # check if the given module might be a sibling module + # return True if it's likely it is + + # if we can't check the file we cannot now + if not hasattr(module, '__file__'): + return False + + # if it's an absolute path then it was probably a system import + if module.__file__.startswith(os.path.sep): + return False + + # if the package name matches the dir, it was an import from ''/cwd + package = module.__name__.split('.')[0] + directory = module.__file__.split(os.path.sep)[0] + + if package == directory: + return False + + return True + # grooming this to be public API to use pychecker as a module def _check(files, cfg=None, suppressions=None, printProcessing=False): # snapshot modules before and after processing, so that we only warn # about the modules loaded because of these files. # preferable to clearing the loaded modules because we don't have to # reprocess previously handled modules - beforeModules = getAllModules() + beforePCModules = getAllPCModules() + beforeModules = dict(sys.modules.items()) utils.initConfig(cfg) utils.debug('main: Checking %d files', len(files)) @@ -263,26 +285,41 @@ importWarnings = processFiles(files, cfg, printProcessing and _print_processing or None) utils.debug('main: Found %d import warnings' % len(importWarnings)) + utils.debug('main: %d modules in sys.modules' % len(sys.modules.keys())) fixupBuiltinModules() - afterModules = getAllModules() + afterPCModules = getAllPCModules() - newModules = afterModules[:] - for m in beforeModules: - if m in newModules: - newModules.remove(m) + newPCModules = afterPCModules[:] + for m in beforePCModules: + if m in newPCModules: + newPCModules.remove(m) + + newModules = dict(sys.modules.items()) + for k, v in beforeModules.items(): + if k in newModules: + del newModules[k] if cfg.printParse : - for module in newModules: + for module in newPCModules: printer.module(module) + utils.debug('main: %d Pychecker modules and %d python modules loaded', + len(newPCModules), len(newModules)) + + # remove all sys.modules suspected of being sibling imports; they now + # pollute the global namespace of sys.modules + for k, v in newModules.items(): + if v and _mightBeSiblingModule(v): + utils.debug('main: unloading python module %s', v) + del sys.modules[k] utils.debug('main: Finding warnings') # suppressions is a tuple of suppressions, suppressionRegexs dicts - warnings = warn.find(newModules, cfg, suppressions) + warnings = warn.find(newPCModules, cfg, suppressions) utils.debug('main: Found %d warnings in %d files and %d modules', - len(importWarnings) + len(warnings), len(files), len(newModules)) + len(importWarnings) + len(warnings), len(files), len(newPCModules)) # FIXME: any way to assert we are popping the one we pushed ? utils.popConfig() |
From: Thomas V. S. <tho...@us...> - 2011-01-21 11:00:27
|
Update of /cvsroot/pychecker/pychecker/test In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20149/test Modified Files: test_internal.py Log Message: * pychecker/CodeChecks.py: Handle sibling imports, where a module could be importing another living in the same directory. When handling IMPORT_NAME, pass the current's module moduleDir as the sibling module dir so we can load the ones that are as such, and tag them properly in the PCModules. * pychecker/check.py: Track both PC Modules and normal python modules added/loaded after importing all files to be checked. Delete the modules that are likely to be a sibling module from sys.modules, because they pollute that namespace by pretending they are an importable module from sys.path when they were a side effect of loading the files we were interested in. * pychecker/checker.py: Find a good moduleDir for the candidate files. * test/test_internal.py: Allow PYCHECKER_DEBUG as an env var so runs of trial can be done with debugging. Fix variables assert. Test now passes. Index: test_internal.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/test/test_internal.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- test_internal.py 18 Jan 2011 09:09:21 -0000 1.17 +++ test_internal.py 21 Jan 2011 11:00:18 -0000 1.18 @@ -29,6 +29,8 @@ def check(self, paths): config = Config.Config() config.ignoreStandardLibrary = 1 + if os.environ.get('PYCHECKER_DEBUG'): + config.debug = 1 from pychecker.check import _check warnings = _check(paths, cfg=config) @@ -160,14 +162,16 @@ # check the module from which we are starimporting; # it should have been loaded as a side effect pcmodule = pcmodules.getPCModule("starimportfrom", moduleDir="input") - # FIXME; pcmodule has wrong moduleDir - pcmodule = pcmodules.getPCModule("starimportfrom", moduleDir=None) + self.failUnless(pcmodule, pcmodules._getPCModulesDict()) self.assertEquals(pcmodule.moduleName, "starimportfrom") self.assertEquals(pcmodule.moduleDir, "input") variables = [v for v in pcmodule.variables.keys() if v not in Config._DEFAULT_VARIABLE_IGNORE_LIST] - self.assertEquals(variables, []) + if utils.pythonVersion() >= utils.PYTHON_2_6: + self.assertEquals(pcmodule.variables.keys(), ["__package__"]) + else: + self.assertEquals(pcmodule.variables.keys(), []) self.assertEquals(pcmodule.classes.keys(), []) self.assertEquals(pcmodule.functions.keys(), ["_", ]) self.assertEquals(pcmodule.modules.keys(), ["gettext", ]) @@ -206,7 +210,5 @@ # self.assertEquals(pcmodule.codes[0].stack, []) self.assertEquals(pcmodule.codes[1].stack, []) - test_star_import.todo = 'make functions keyed on alias' - if __name__ == '__main__': unittest.main() |
From: Thomas V. S. <tho...@us...> - 2011-01-21 11:00:27
|
Update of /cvsroot/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20149 Modified Files: ChangeLog Log Message: * pychecker/CodeChecks.py: Handle sibling imports, where a module could be importing another living in the same directory. When handling IMPORT_NAME, pass the current's module moduleDir as the sibling module dir so we can load the ones that are as such, and tag them properly in the PCModules. * pychecker/check.py: Track both PC Modules and normal python modules added/loaded after importing all files to be checked. Delete the modules that are likely to be a sibling module from sys.modules, because they pollute that namespace by pretending they are an importable module from sys.path when they were a side effect of loading the files we were interested in. * pychecker/checker.py: Find a good moduleDir for the candidate files. * test/test_internal.py: Allow PYCHECKER_DEBUG as an env var so runs of trial can be done with debugging. Fix variables assert. Test now passes. Index: ChangeLog =================================================================== RCS file: /cvsroot/pychecker/pychecker/ChangeLog,v retrieving revision 1.143 retrieving revision 1.144 diff -u -d -r1.143 -r1.144 --- ChangeLog 21 Jan 2011 10:33:31 -0000 1.143 +++ ChangeLog 21 Jan 2011 11:00:18 -0000 1.144 @@ -1,6 +1,29 @@ 2011-01-21 Thomas Vander Stichele <thomas at apestaart dot org> * pychecker/CodeChecks.py: + Handle sibling imports, where a module could be importing another + living in the same directory. + When handling IMPORT_NAME, pass the current's module moduleDir as + the sibling module dir so we can load the ones that are as such, + and tag them properly in the PCModules. + * pychecker/check.py: + Track both PC Modules and normal python modules added/loaded after + importing all files to be checked. + Delete the modules that are likely to be a sibling module from + sys.modules, because they pollute that namespace by pretending they + are an importable module from sys.path when they were a side effect + of loading the files we were interested in. + * pychecker/checker.py: + Find a good moduleDir for the candidate files. + * test/test_internal.py: + Allow PYCHECKER_DEBUG as an env var so runs of trial can be done + with debugging. + Fix variables assert. + Test now passes. + +2011-01-21 Thomas Vander Stichele <thomas at apestaart dot org> + + * pychecker/CodeChecks.py: Make it clear when handling IMPORT_STAR whether we are actually able to import because we've loaded the module. |
From: Thomas V. S. <tho...@us...> - 2011-01-21 10:33:41
|
Update of /cvsroot/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15663 Modified Files: ChangeLog Log Message: * pychecker/CodeChecks.py: Make it clear when handling IMPORT_STAR whether we are actually able to import because we've loaded the module. Index: ChangeLog =================================================================== RCS file: /cvsroot/pychecker/pychecker/ChangeLog,v retrieving revision 1.142 retrieving revision 1.143 diff -u -d -r1.142 -r1.143 --- ChangeLog 18 Jan 2011 09:09:21 -0000 1.142 +++ ChangeLog 21 Jan 2011 10:33:31 -0000 1.143 @@ -1,3 +1,9 @@ +2011-01-21 Thomas Vander Stichele <thomas at apestaart dot org> + + * pychecker/CodeChecks.py: + Make it clear when handling IMPORT_STAR whether we are actually + able to import because we've loaded the module. + 2011-01-18 Thomas Vander Stichele <thomas at apestaart dot org> * test/test_internal.py: |
From: Thomas V. S. <tho...@us...> - 2011-01-21 10:33:41
|
Update of /cvsroot/pychecker/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15663/pychecker Modified Files: CodeChecks.py Log Message: * pychecker/CodeChecks.py: Make it clear when handling IMPORT_STAR whether we are actually able to import because we've loaded the module. Index: CodeChecks.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/CodeChecks.py,v retrieving revision 1.224 retrieving revision 1.225 diff -u -d -r1.224 -r1.225 --- CodeChecks.py 18 Jan 2011 09:09:21 -0000 1.224 +++ CodeChecks.py 21 Jan 2011 10:33:32 -0000 1.225 @@ -636,10 +636,15 @@ # if fromModule: # assert isinstance(fromModule, pcmodules.PyCheckerModule) - if isinstance(fromWhere, pcmodules.PyCheckerModule) and operand == '*': - utils.debug('Handling * import, adding %r', fromWhere.getTokenNames()) - for name in fromWhere.getTokenNames(): - module.addImported(name, code.getLineNum(), fromWhere) + if operand == '*': + if isinstance(fromWhere, pcmodules.PyCheckerModule): + utils.debug('Handling * import, adding %r', + fromWhere.getTokenNames()) + for name in fromWhere.getTokenNames(): + module.addImported(name, code.getLineNum(), fromWhere) + else: + utils.debug('Handling * import, but no PC module for %r', + fromWhere) # FIXME: direct names imported should be added too |
From: Thomas V. S. <tho...@us...> - 2011-01-20 09:49:35
|
Update of /cvsroot/pychecker/pychecker/test/input In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24216/test/input Added Files: nestedmodule.py Log Message: add another test that currently triggers a wrong warning about unused module --- NEW FILE: nestedmodule.py --- import struct class MyClass(object): class NestedClass(object): myStruct = struct.Struct('!LLL') |
From: Thomas V. S. <tho...@us...> - 2011-01-18 09:09:29
|
Update of /cvsroot/pychecker/pychecker/test In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15110/test Modified Files: test_internal.py Log Message: * test/test_internal.py: Add another assert. * pychecker/CodeChecks.py: Fix getting module names with * in it when doing star imports. Index: test_internal.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/test/test_internal.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- test_internal.py 18 Jan 2011 07:42:28 -0000 1.16 +++ test_internal.py 18 Jan 2011 09:09:21 -0000 1.17 @@ -160,6 +160,8 @@ # check the module from which we are starimporting; # it should have been loaded as a side effect pcmodule = pcmodules.getPCModule("starimportfrom", moduleDir="input") + # FIXME; pcmodule has wrong moduleDir + pcmodule = pcmodules.getPCModule("starimportfrom", moduleDir=None) self.assertEquals(pcmodule.moduleName, "starimportfrom") self.assertEquals(pcmodule.moduleDir, "input") |
From: Thomas V. S. <tho...@us...> - 2011-01-18 09:09:29
|
Update of /cvsroot/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15110 Modified Files: ChangeLog Log Message: * test/test_internal.py: Add another assert. * pychecker/CodeChecks.py: Fix getting module names with * in it when doing star imports. Index: ChangeLog =================================================================== RCS file: /cvsroot/pychecker/pychecker/ChangeLog,v retrieving revision 1.141 retrieving revision 1.142 diff -u -d -r1.141 -r1.142 --- ChangeLog 18 Jan 2011 07:42:27 -0000 1.141 +++ ChangeLog 18 Jan 2011 09:09:21 -0000 1.142 @@ -1,5 +1,12 @@ 2011-01-18 Thomas Vander Stichele <thomas at apestaart dot org> + * test/test_internal.py: + Add another assert. + * pychecker/CodeChecks.py: + Fix getting module names with * in it when doing star imports. + +2011-01-18 Thomas Vander Stichele <thomas at apestaart dot org> + * pychecker/pcmodules.py: Allow getting the whole dict, for testing. * test/test_internal.py: |
From: Thomas V. S. <tho...@us...> - 2011-01-18 09:09:29
|
Update of /cvsroot/pychecker/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15110/pychecker Modified Files: CodeChecks.py Log Message: * test/test_internal.py: Add another assert. * pychecker/CodeChecks.py: Fix getting module names with * in it when doing star imports. Index: CodeChecks.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/pychecker/CodeChecks.py,v retrieving revision 1.223 retrieving revision 1.224 diff -u -d -r1.223 -r1.224 --- CodeChecks.py 13 Jan 2011 15:08:29 -0000 1.223 +++ CodeChecks.py 18 Jan 2011 09:09:21 -0000 1.224 @@ -719,12 +719,19 @@ code.popNextOp() if isinstance(fromOperandData, pcmodules.PyCheckerModule): - fullName = "%s.%s" % (fromOperandData.moduleName, operand) + moduleName = fromOperandData.moduleName + moduleDir = fromOperandData.moduleDir else: - fullName = "%s.%s" % (fromOperandData, operand) + moduleName = fromOperandData + moduleDir = None + + if operand == '*': + fullName = moduleName + else: + fullName = "%s.%s" % (moduleName, operand) try: - pcmodule = _getOrLoadPCModule(code, fullName) + pcmodule = _getOrLoadPCModule(code, fullName, moduleDir) code.pushStack(Stack.Item(pcmodule, types.ModuleType)) except ImportError: # FIXME: so what is it ? what do we push ? @@ -1681,7 +1688,7 @@ _checkNoEffect(code) -def _getOrLoadPCModule(code, name): +def _getOrLoadPCModule(code, name, moduleDir=None): """ Retrieve a previously loaded PyChecker module by name, or load it. @@ -1692,9 +1699,10 @@ @rtype: L{pcmodules.PyCheckerModule} """ - pcmodule = pcmodules.getPCModule(name) + assert '*' not in name, "Name %r contains an asterisk" % name + pcmodule = pcmodules.getPCModule(name, moduleDir=moduleDir) if not pcmodule: - pcmodule = pcmodules.PyCheckerModule(name) + pcmodule = pcmodules.PyCheckerModule(name, moduleDir=moduleDir) try: pcmodule.load(allowImportError=True) except ImportError, e: |
From: Thomas V. S. <tho...@us...> - 2011-01-18 08:19:13
|
Update of /cvsroot/pychecker/pychecker In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4540 Modified Files: TODO Log Message: add another TODO Index: TODO =================================================================== RCS file: /cvsroot/pychecker/pychecker/TODO,v retrieving revision 1.170 retrieving revision 1.171 diff -u -d -r1.170 -r1.171 --- TODO 17 Jan 2011 21:27:48 -0000 1.170 +++ TODO 18 Jan 2011 08:19:05 -0000 1.171 @@ -228,6 +228,7 @@ that instead ?) - fix pychecker flumotion/twisted/credentials.py versus flumotion.twisted.credentials +- flumotion/common/options.py: _gobject is not defined problem; add test Admin ----- |
From: Thomas V. S. <tho...@us...> - 2011-01-18 07:42:39
|
Update of /cvsroot/pychecker/pychecker/test In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28798/test Modified Files: test_internal.py Log Message: * pychecker/pcmodules.py: Allow getting the whole dict, for testing. * test/test_internal.py: Add a test that shows that we are creating bogus modules when doing star imports. Index: test_internal.py =================================================================== RCS file: /cvsroot/pychecker/pychecker/test/test_internal.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- test_internal.py 17 Jan 2011 21:17:51 -0000 1.15 +++ test_internal.py 18 Jan 2011 07:42:28 -0000 1.16 @@ -152,6 +152,11 @@ # FIXME: why do we have a non-empty stack here ? # self.assertEquals(pcmodule.codes[0].stack, []) + modules = pcmodules._getPCModulesDict() + for (name, moduleDir) in modules.keys(): + self.failIf(name.find('*') > -1, + 'Invalid loaded module name %s' % (name, )) + # check the module from which we are starimporting; # it should have been loaded as a side effect pcmodule = pcmodules.getPCModule("starimportfrom", moduleDir="input") |