diff options
author | scoder <stefan_ml@behnel.de> | 2018-09-24 22:21:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-24 22:21:53 +0200 |
commit | cf7b60ff6814ce8faf7fab2990c423452faa2f0a (patch) | |
tree | 3039d1f414806cb5b644612ae7308ee1ac81c177 /Cython/Compiler/Main.py | |
parent | b6509bf791bfe44abbbaa957ae530e5910815dfd (diff) | |
parent | cea42915c5e9ea1da9187aa3c55f3f16d04ba1e3 (diff) | |
download | cython-0.29rc1.tar.gz |
Merge pull request #2625 from cython/str_is_str_gh25650.29rc1
Add a new directive 'str_is_str=True'
Diffstat (limited to 'Cython/Compiler/Main.py')
-rw-r--r-- | Cython/Compiler/Main.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py index 411ef0a8f..1dfc4baf1 100644 --- a/Cython/Compiler/Main.py +++ b/Cython/Compiler/Main.py @@ -94,9 +94,18 @@ class Context(object): if language_level is not None: self.set_language_level(language_level) + if self.compiler_directives.get('str_is_str') is not None: + self.set_str_is_str(self.compiler_directives['str_is_str']) self.gdb_debug_outputwriter = None + def set_str_is_str(self, str_is_str): + from .Future import unicode_literals + if str_is_str: + self.future_directives.discard(unicode_literals) + else: + self.future_directives.add(unicode_literals) + def set_language_level(self, level): self.language_level = level if level >= 3: |