summaryrefslogtreecommitdiff
path: root/Cython/Compiler/Main.py
diff options
context:
space:
mode:
authorscoder <stefan_ml@behnel.de>2018-09-24 22:21:53 +0200
committerGitHub <noreply@github.com>2018-09-24 22:21:53 +0200
commitcf7b60ff6814ce8faf7fab2990c423452faa2f0a (patch)
tree3039d1f414806cb5b644612ae7308ee1ac81c177 /Cython/Compiler/Main.py
parentb6509bf791bfe44abbbaa957ae530e5910815dfd (diff)
parentcea42915c5e9ea1da9187aa3c55f3f16d04ba1e3 (diff)
downloadcython-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.py9
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: