Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
a843539a
Kaydet (Commit)
a843539a
authored
Ock 05, 2013
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #12914 -- Use yaml faster C implementation when available
Thanks Beuc for the report and the initial patch.
üst
c8eff0db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
pyyaml.py
django/core/serializers/pyyaml.py
+9
-2
No files found.
django/core/serializers/pyyaml.py
Dosyayı görüntüle @
a843539a
...
...
@@ -14,8 +14,15 @@ from django.core.serializers.python import Serializer as PythonSerializer
from
django.core.serializers.python
import
Deserializer
as
PythonDeserializer
from
django.utils
import
six
# Use the C (faster) implementation if possible
try
:
from
yaml
import
CSafeLoader
as
SafeLoader
from
yaml
import
CSafeDumper
as
SafeDumper
except
ImportError
:
from
yaml
import
SafeLoader
,
SafeDumper
class
DjangoSafeDumper
(
yaml
.
SafeDumper
):
class
DjangoSafeDumper
(
SafeDumper
):
def
represent_decimal
(
self
,
data
):
return
self
.
represent_scalar
(
'tag:yaml.org,2002:str'
,
str
(
data
))
...
...
@@ -58,7 +65,7 @@ def Deserializer(stream_or_string, **options):
else
:
stream
=
stream_or_string
try
:
for
obj
in
PythonDeserializer
(
yaml
.
safe_load
(
stream
),
**
options
):
for
obj
in
PythonDeserializer
(
yaml
.
load
(
stream
,
Loader
=
SafeLoader
),
**
options
):
yield
obj
except
GeneratorExit
:
raise
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment