Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
BF: PsychoPy constants should be valid values when doing validation o…
…n code snippets, partially fixes #3320
  • Loading branch information
Todd authored and peircej committed Dec 4, 2020
1 parent 4640e37 commit 40bbfe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion psychopy/app/builder/validators.py
Expand Up @@ -240,7 +240,7 @@ def _highlightParamVal(parent, error=False):

for newName in names:
namespace = parent.frame.exp.namespace
if newName in namespace.user or newName in namespace.builder:
if newName in [*namespace.user, *namespace.builder, *namespace.constants]:
continue
used = namespace.exists(newName)
sameAsOldName = bool(newName == parent.params['name'].val)
Expand Down
3 changes: 2 additions & 1 deletion psychopy/experiment/exports.py
Expand Up @@ -147,7 +147,8 @@ def __init__(self, exp):
# noinspection PyUnresolvedReferences
self.keywords = keyword.kwlist + dir(__builtins__)
# these are based on a partial test, known to be incomplete:
self.psychopy = psychopy.__all__ + ['psychopy', 'os'] + dir(constants)
self.psychopy = psychopy.__all__ + ['psychopy', 'os']
self.constants = dir(constants)
self.builder = ['KeyResponse', 'keyboard', 'buttons',
'continueRoutine', 'expInfo', 'expName', 'thisExp',
'filename', 'logFile', 'paramName',
Expand Down

0 comments on commit 40bbfe1

Please sign in to comment.