Skip to content

Commit 2f956d6

Browse files
committed
Handle more white spaces
1 parent 3371731 commit 2f956d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bpython/line.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def current_object_attribute(cursor_offset, line):
114114

115115

116116
current_from_import_from_re = LazyReCompile(
117-
r"from ([\w0-9_.]*)(?:\s+import\s+([\w0-9_]+[,]?\s*)+)*"
117+
r"from +([\w0-9_.]*)(?:\s+import\s+([\w0-9_]+[,]?\s*)+)*"
118118
)
119119

120120

@@ -136,9 +136,9 @@ def current_from_import_from(cursor_offset, line):
136136
return None
137137

138138

139-
current_from_import_import_re_1 = LazyReCompile(r"from\s([\w0-9_.]*)\s+import")
139+
current_from_import_import_re_1 = LazyReCompile(r"from\s+([\w0-9_.]*)\s+import")
140140
current_from_import_import_re_2 = LazyReCompile(r"([\w0-9_]+)")
141-
current_from_import_import_re_3 = LazyReCompile(r"[,][ ]([\w0-9_]*)")
141+
current_from_import_import_re_3 = LazyReCompile(r", *([\w0-9_]*)")
142142

143143

144144
def current_from_import_import(cursor_offset, line):
@@ -165,7 +165,7 @@ def current_from_import_import(cursor_offset, line):
165165

166166
current_import_re_1 = LazyReCompile(r"import")
167167
current_import_re_2 = LazyReCompile(r"([\w0-9_.]+)")
168-
current_import_re_3 = LazyReCompile(r"[,][ ]([\w0-9_.]*)")
168+
current_import_re_3 = LazyReCompile(r"[,][ ]*([\w0-9_.]*)")
169169

170170

171171
def current_import(cursor_offset, line):

0 commit comments

Comments
 (0)