File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ def print_suite(suite):
54
54
from .lexer import TestCaseFileLexer , ResourceFileLexer
55
55
from .nodes import TestCaseSection
56
56
from .parser import RobotFrameworkParser
57
+ from . import lexerwrapper
57
58
58
59
59
60
# TODO: remove/inline
@@ -74,12 +75,10 @@ def get_resource_file_ast(source):
74
75
def disable_curdir_processing (method ):
75
76
"""Decorator to disable processing `${CURDIR}` variable."""
76
77
def decorated (* args , ** kwargs ):
77
- pass
78
- # FIXME
79
- # original = populators.PROCESS_CURDIR
80
- # populators.PROCESS_CURDIR = False
81
- # try:
82
- # return method(*args, **kwargs)
83
- # finally:
84
- # populators.PROCESS_CURDIR = original
85
- return method
78
+ original = lexerwrapper .PROCESS_CURDIR
79
+ lexerwrapper .PROCESS_CURDIR = False
80
+ try :
81
+ return method (* args , ** kwargs )
82
+ finally :
83
+ lexerwrapper .PROCESS_CURDIR = original
84
+ return decorated
Original file line number Diff line number Diff line change 20
20
from robot .utils import Utf8Reader , get_error_message
21
21
22
22
23
+ PROCESS_CURDIR = True
24
+
25
+
23
26
class LexerWrapper (object ):
24
27
25
28
def __init__ (self , lexer , source ):
@@ -42,7 +45,7 @@ def token(self):
42
45
if token and token .type == token .ERROR :
43
46
self ._report_error (token )
44
47
return self ._next_token_after_eos ()
45
- if token and '${CURDIR}' in token .value :
48
+ if token and '${CURDIR}' in token .value and PROCESS_CURDIR :
46
49
token .value = token .value .replace ('${CURDIR}' , self .curdir )
47
50
return token
48
51
You can’t perform that action at this time.
0 commit comments