Python 2 compatibility
This commit is contained in:
1 parent
4b8505b78d
commit
98a550e352
2 files changed
+7
-4
No files matched your search
@@ -26,8 +26,11 @@ class _ModuleAttributeName(AbstractNameDefinition):
|
||||
|
||||
def infer(self):
|
||||
if self._string_value is not None:
|
||||
s = self._string_value
|
||||
if self.parent_context.evaluator.environment.version_info.major == 2:
|
||||
s = bytes(s)
|
||||
return ContextSet([
|
||||
create_simple_object(self.parent_context.evaluator, self._string_value)
|
||||
create_simple_object(self.parent_context.evaluator, s)
|
||||
])
|
||||
return compiled.get_string_context_set(self.parent_context.evaluator)
|
||||
|
||||
|
||||
Reference in new issue
Block a user